mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Fix issue when subzone is a non-dotted endswith for zone
This commit is contained in:
+4
-3
@@ -315,12 +315,13 @@ class Manager(object):
|
||||
while zones:
|
||||
# Grab the one we'lre going to work on now
|
||||
zone = zones.pop()
|
||||
trimmer = len(zone) + 1
|
||||
dotted = f'.{zone}'
|
||||
trimmer = len(dotted)
|
||||
subs = set()
|
||||
# look at all the zone names that come after it
|
||||
for candidate in zones:
|
||||
# If they end with this zone's name them they're a sub
|
||||
if candidate.endswith(zone):
|
||||
# If they end with this zone's dotted name, it's a sub
|
||||
if candidate.endswith(dotted):
|
||||
# We want subs to exclude the zone portion
|
||||
subs.add(candidate[:-trimmer])
|
||||
|
||||
|
||||
@@ -776,6 +776,17 @@ class TestManager(TestCase):
|
||||
set(), manager.configured_sub_zones('skipped.alevel.unit2.tests.')
|
||||
)
|
||||
|
||||
# zones that end with names of others
|
||||
manager.config['zones'] = {
|
||||
'unit.tests.': {},
|
||||
'uunit.tests.': {},
|
||||
'uuunit.tests.': {},
|
||||
}
|
||||
manager._configured_sub_zones = None
|
||||
self.assertEqual(set(), manager.configured_sub_zones('unit.tests.'))
|
||||
self.assertEqual(set(), manager.configured_sub_zones('uunit.tests.'))
|
||||
self.assertEqual(set(), manager.configured_sub_zones('uuunit.tests.'))
|
||||
|
||||
|
||||
class TestMainThreadExecutor(TestCase):
|
||||
def test_success(self):
|
||||
|
||||
Reference in New Issue
Block a user