From 5a11bc7bf589d8077114983caec0509894f3936b Mon Sep 17 00:00:00 2001 From: Robert Spadaro Date: Thu, 25 Jan 2024 13:23:13 -0500 Subject: [PATCH 1/4] Skip Directional Pool records --- CHANGELOG.md | 4 +++ octodns_ultra/__init__.py | 13 ++++++++ tests/fixtures/ultra-records-page-1.json | 42 ++++++++++++++++++++++++ 3 files changed, 59 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dec25c3..7c21350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.0.5 - 2024-01-25 + +* Skip unsupported dynamic record type "Directional Pool" + ## v0.0.4 - 2024-01-25 * Enable support for wildcard zone lookups (list_zones()) diff --git a/octodns_ultra/__init__.py b/octodns_ultra/__init__.py index 677dd2a..7364e81 100644 --- a/octodns_ultra/__init__.py +++ b/octodns_ultra/__init__.py @@ -328,6 +328,19 @@ def populate(self, zone, target=False, lenient=False): name = zone.hostname_from_fqdn(record['ownerName']) if record['rrtype'] == 'SOA (6)': continue + if ( + record['rrtype'] == 'A (1)' + and 'profile' in record + and record['profile']['@context'] + == 'http://schemas.ultradns.com/DirPool.jsonschema' + ): + self.log.warning( + 'populate: ignoring record with ' + 'unsupported type, %s %s', + name, + '[Directional Pool (Dynamic)]', + ) + continue try: _type = self.RECORDS_TO_TYPE[record['rrtype']] except KeyError: diff --git a/tests/fixtures/ultra-records-page-1.json b/tests/fixtures/ultra-records-page-1.json index 8614427..4d20f88 100644 --- a/tests/fixtures/ultra-records-page-1.json +++ b/tests/fixtures/ultra-records-page-1.json @@ -84,6 +84,48 @@ "rdata": [ "v=spf1 -all" ] + }, + { + "ownerName": "dirpool.octodns1.test.", + "profile": { + "@context": "http://schemas.ultradns.com/DirPool.jsonschema", + "description": "dirpool.octodns1.test", + "ignoreECS": false, + "rdataInfo": [ + { + "allNonConfigured": true, + "ttl": 600, + "type": "A" + }, + { + "geoInfo": { + "codes": [ + "CA" + ], + "name": "xxx" + }, + "ttl": 86400, + "type": "SF" + }, + { + "geoInfo": { + "codes": [ + "ASI", + "OCN" + ], + "name": "yyy" + }, + "ttl": 86400, + "type": "SF" + } + ] + }, + "rdata": [ + "127.0.0.1", + "xxxrecord.octodns1.test.", + "yyyrecord.octodns1.test." + ], + "rrtype": "A (1)" } ], "resultInfo": { From d36b445f4a82440e9d7e5067868ffcc2c5bb78c8 Mon Sep 17 00:00:00 2001 From: squintfox <55590532+squintfox@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:37:33 -0500 Subject: [PATCH 2/4] Update octodns_ultra/__init__.py Co-authored-by: Ross McFarland --- octodns_ultra/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/octodns_ultra/__init__.py b/octodns_ultra/__init__.py index 7364e81..f2281d4 100644 --- a/octodns_ultra/__init__.py +++ b/octodns_ultra/__init__.py @@ -330,8 +330,7 @@ def populate(self, zone, target=False, lenient=False): continue if ( record['rrtype'] == 'A (1)' - and 'profile' in record - and record['profile']['@context'] + and record.get('profile', {}).get('@context']) == 'http://schemas.ultradns.com/DirPool.jsonschema' ): self.log.warning( From e58e5e79b6ba5fbe84e790580dbf44778fb2bf22 Mon Sep 17 00:00:00 2001 From: squintfox <55590532+squintfox@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:38:25 -0500 Subject: [PATCH 3/4] Update octodns_ultra/__init__.py Co-authored-by: Ross McFarland --- octodns_ultra/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/octodns_ultra/__init__.py b/octodns_ultra/__init__.py index f2281d4..c178f36 100644 --- a/octodns_ultra/__init__.py +++ b/octodns_ultra/__init__.py @@ -334,10 +334,8 @@ def populate(self, zone, target=False, lenient=False): == 'http://schemas.ultradns.com/DirPool.jsonschema' ): self.log.warning( - 'populate: ignoring record with ' - 'unsupported type, %s %s', + 'populate: ignoring record with unsupported type, %s [Directional Pool (Dynamic)]', name, - '[Directional Pool (Dynamic)]', ) continue try: From c088098f2d9b5d6bdee1f70d943579651c9a2b34 Mon Sep 17 00:00:00 2001 From: Robert Spadaro Date: Fri, 26 Jan 2024 09:51:08 -0500 Subject: [PATCH 4/4] Remove errant bracket --- octodns_ultra/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns_ultra/__init__.py b/octodns_ultra/__init__.py index c178f36..2f437d4 100644 --- a/octodns_ultra/__init__.py +++ b/octodns_ultra/__init__.py @@ -330,7 +330,7 @@ def populate(self, zone, target=False, lenient=False): continue if ( record['rrtype'] == 'A (1)' - and record.get('profile', {}).get('@context']) + and record.get('profile', {}).get('@context') == 'http://schemas.ultradns.com/DirPool.jsonschema' ): self.log.warning(