diff options
| author | 2023-12-26 19:39:06 -0500 | |
|---|---|---|
| committer | 2023-12-26 19:39:06 -0500 | |
| commit | fa197fe27b8a03bbf4504476f842956ece2c76c9 (patch) | |
| tree | 5a75b92e4c731a4b2ced68eadb9581a8c922d82e /pkb_client/helper.py | |
Import Upstream version 1.2upstream/1.2
Diffstat (limited to 'pkb_client/helper.py')
| -rw-r--r-- | pkb_client/helper.py | 15 |
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 |
