Commit a8bd18ab authored by Jelte Jansen's avatar Jelte Jansen
Browse files

fix; only initialize fully if it hasn't been done yet, otherwise only update...

fix; only initialize fully if it hasn't been done yet, otherwise only update the specifications and the configuration as known by the manager, not the local changes


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac285@2440 e5f2f494-b856-4b98-b285-d166d9295462
parent 2c800eb2
......@@ -102,7 +102,8 @@ class BindCmdInterpreter(Cmd):
self.conn = ValidatedHTTPSConnection(self.server_port,
ca_certs=pem_file)
self.session_id = self._get_session_id()
self.config_data = None
def _get_session_id(self):
'''Generate one session id for the connection. '''
rand = os.urandom(16)
......@@ -252,7 +253,10 @@ class BindCmdInterpreter(Cmd):
should be called before interpreting command line or complete-key
is entered. This may not be the best way to keep bindctl
and cmdctl share same modules information, but it works.'''
self.config_data = isc.config.UIModuleCCSession(self)
if self.config_data is not None:
self.config_data.update_specs_and_config()
else:
self.config_data = isc.config.UIModuleCCSession(self)
self._update_commands()
def precmd(self, line):
......
......@@ -323,6 +323,10 @@ class UIModuleCCSession(MultiConfigData):
for module in specs.keys():
self.set_specification(isc.config.ModuleSpec(specs[module]))
def update_specs_and_config(self):
self.request_specifications();
self.request_current_config();
def request_current_config(self):
"""Requests the current configuration from the configuration
manager through b10-cmdctl, and stores those as CURRENT"""
......@@ -331,6 +335,7 @@ class UIModuleCCSession(MultiConfigData):
raise ModuleCCSessionError("Bad config version")
self._set_current_config(config)
def add_value(self, identifier, value_str):
"""Add a value to a configuration list. Raises a DataTypeError
if the value does not conform to the list_item_spec field
......
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