Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastian Schrader
Kea
Commits
cf5b24f1
Commit
cf5b24f1
authored
Mar 18, 2011
by
Michal 'vorner' Vaner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[trac670] The config handler
parent
5a7c1928
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
src/bin/zonemgr/tests/zonemgr_test.py
src/bin/zonemgr/tests/zonemgr_test.py
+7
-6
src/bin/zonemgr/zonemgr.py.in
src/bin/zonemgr/zonemgr.py.in
+14
-5
No files found.
src/bin/zonemgr/tests/zonemgr_test.py
View file @
cf5b24f1
...
...
@@ -530,7 +530,8 @@ class TestZonemgr(unittest.TestCase):
"jitter_scope"
:
0.1
,
"secondary_zones"
:
[]
}
self
.
zonemgr
.
config_handler
(
config_data1
)
self
.
assertEqual
(
self
.
zonemgr
.
config_handler
(
config_data1
),
{
"result"
:
[
0
]})
self
.
assertEqual
(
config_data1
,
self
.
zonemgr
.
_config_data
)
config_data2
=
{
"zone_name"
:
"sd.cn."
,
"port"
:
"53"
,
"master"
:
"192.168.1.1"
}
self
.
zonemgr
.
config_handler
(
config_data2
)
...
...
src/bin/zonemgr/zonemgr.py.in
View file @
cf5b24f1
...
...
@@ -490,15 +490,24 @@ class Zonemgr:
def config_handler(self, new_config):
""" Update config data. """
answer = create_answer(0)
ok = True
complete = copy.copy(self._config_data)
for key in new_config:
if key not in
self._config_data
:
if key not in
complete
:
answer = create_answer(1, "Unknown config data: " + str(key))
ok = False
continue
self._config_data
[key] = new_config[key]
complete
[key] = new_config[key]
self._config_data_check(
self._config_data
)
self._config_data_check(
complete
)
if self._zone_refresh is not None:
self._zone_refresh.update_config_data(self._config_data)
try:
self._zone_refresh.update_config_data(complete)
except Exception as e:
answer = create_answer(1, str(e))
ok = False
if ok:
self._config_data = complete
return answer
...
...
Write
Preview
Markdown
is supported
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