Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
47b51ddc
Commit
47b51ddc
authored
Apr 05, 2011
by
Michal 'vorner' Vaner
Browse files
[trac670] Be tolerant to missing final dot
parent
c139d4bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/zonemgr/tests/zonemgr_test.py
View file @
47b51ddc
...
...
@@ -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
...
...
src/bin/zonemgr/zonemgr.py.in
View file @
47b51ddc
...
...
@@ -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:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment