Commit 47b51ddc authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac670] Be tolerant to missing final dot

parent c139d4bf
......@@ -460,6 +460,11 @@ class TestZonemgrRefresh(unittest.TestCase):
# So it should not affect the old ones
self.assertTrue(("", "IN") in
# Make sure it works even when we "accidentally" forget the final dot
config.set_zone_list_from_name_classes([("", "IN")])
self.assertTrue(("", "IN") in
def tearDown(self):
sys.stderr= self.stderr_backup
......@@ -408,7 +408,11 @@ class ZonemgrRefresh:
required = {}
# Add new zones
for secondary_zone in new_config.get('secondary_zones'):
name_class = (secondary_zone['name'], secondary_zone['class'])
name = secondary_zone['name']
# Be tolerant to sclerotic users who forget the final dot
if name[-1] != '.':
name = name + '.'
name_class = (name, secondary_zone['class'])
required[name_class] = True
# Add it only if it isn't there already
if not name_class in self._zonemgr_refresh_info:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment