summaryrefslogtreecommitdiffstats
path: root/pkb_client/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'pkb_client/helper.py')
-rw-r--r--pkb_client/helper.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkb_client/helper.py b/pkb_client/helper.py
new file mode 100644
index 0000000..0c08167
--- /dev/null
+++ b/pkb_client/helper.py
@@ -0,0 +1,15 @@
+def parse_dns_record(record: dict) -> dict:
+ """
+ Parse the DNS record.
+ Replace the ttl and prio string values with the int values.
+
+ :param record: the unparsed DNS record dict
+
+ :return: the parsed dns record dict
+ """
+ if record.get("ttl", None) is not None:
+ record["ttl"] = int(record["ttl"])
+ if record.get("prio", None) is not None:
+ record["prio"] = int(record["prio"])
+
+ return record