1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Base support for managing root NS records

* Zone object no longer treats them special, some tests needed adjusting
  b/c of this, some provider's tests may also need adjusting, though
  they should not plan changes since they won't (yet) have
  SUPPORTS_ROOT_NS
* _process_desired_zone filters and warns when not supported
* YamlProvider supports them
* TinyDnsBaseSource supports them
This commit is contained in:
Ross McFarland
2022-02-08 10:26:49 -08:00
parent e0a5f4d746
commit 33a10eada4
9 changed files with 54 additions and 30 deletions

View File

@@ -24,12 +24,6 @@ class InvalidNodeException(Exception):
pass
def _is_eligible(record):
# Should this record be considered when computing changes
# We ignore all top-level NS records
return record._type != 'NS' or record.name != ''
class Zone(object):
log = getLogger('Zone')
@@ -118,7 +112,7 @@ class Zone(object):
changes = []
# Find diffs & removes
for record in filter(_is_eligible, self.records):
for record in self.records:
if record.ignored:
continue
elif len(record.included) > 0 and \
@@ -168,7 +162,7 @@ class Zone(object):
# Find additions, things that are in desired, but missing in ourselves.
# This uses set math and our special __hash__ and __cmp__ functions as
# well
for record in filter(_is_eligible, desired.records - self.records):
for record in desired.records - self.records:
if record.ignored:
continue
elif len(record.included) > 0 and \