Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
fd7baa38
Commit
fd7baa38
authored
Jan 18, 2011
by
Jelte Jansen
Browse files
Merge branch 'trac435'
parents
ce14d5ca
32e9990a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bin/cfgmgr/b10-cfgmgr.py.in
View file @
fd7baa38
...
...
@@ -61,8 +61,6 @@ def main():
except ConfigManagerDataReadError as cmdre:
print("[b10-cfgmgr] " + str(cmdre))
return 2
if cm:
return cm.write_config()
return 0
if __name__ == "__main__":
...
...
src/bin/cfgmgr/tests/b10-cfgmgr_test.py.in
View file @
fd7baa38
...
...
@@ -58,7 +58,8 @@ class TestConfigManagerStartup(unittest.TestCase):
self.assertTrue(b.cm.read_config_called)
self.assertTrue(b.cm.notify_boss_called)
self.assertTrue(b.cm.run_called)
self.assertTrue(b.cm.write_config_called)
# if there are no changes, config is not written
self.assertFalse(b.cm.write_config_called)
self.assertTrue(b.cm.running)
b.signal_handler(None, None)
...
...
src/lib/python/isc/config/cfgmgr.py
View file @
fd7baa38
...
...
@@ -26,6 +26,7 @@ import os
import
copy
import
tempfile
import
json
import
errno
from
isc.cc
import
data
from
isc.config
import
ccsession
,
config_data
...
...
@@ -87,7 +88,12 @@ class ConfigManagerData:
else
:
raise
ConfigManagerDataReadError
(
"No version information in configuration file "
+
config
.
db_filename
)
except
IOError
as
ioe
:
raise
ConfigManagerDataEmpty
(
"No configuration file found"
)
# if IOError is 'no such file or directory', then continue
# (raise empty), otherwise fail (raise error)
if
ioe
.
errno
==
errno
.
ENOENT
:
raise
ConfigManagerDataEmpty
(
"No configuration file found"
)
else
:
raise
ConfigManagerDataReadError
(
"Can't read configuration file: "
+
str
(
ioe
))
except
ValueError
:
raise
ConfigManagerDataReadError
(
"Configuration file out of date or corrupt, please update or remove "
+
config
.
db_filename
)
finally
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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