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

[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(("sd.cn.", "IN") in
self.zone_refresh._zonemgr_refresh_info)
# Make sure it works even when we "accidentally" forget the final dot
config.set_zone_list_from_name_classes([("sd.cn", "IN")])
self.zone_refresh.update_config_data(config)
self.assertTrue(("sd.cn.", "IN") in
self.zone_refresh._zonemgr_refresh_info)
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:
......
Markdown is supported
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