[svn] commit: r2440 - in /branches/trac285/src: bin/bindctl/bindcmd.py lib/python/isc/config/ccsession.py

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jul 8 14:47:17 UTC 2010


Author: jelte
Date: Thu Jul  8 14:47:16 2010
New Revision: 2440

Log:
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

Modified:
    branches/trac285/src/bin/bindctl/bindcmd.py
    branches/trac285/src/lib/python/isc/config/ccsession.py

Modified: branches/trac285/src/bin/bindctl/bindcmd.py
==============================================================================
--- branches/trac285/src/bin/bindctl/bindcmd.py (original)
+++ branches/trac285/src/bin/bindctl/bindcmd.py Thu Jul  8 14:47:16 2010
@@ -102,7 +102,8 @@
         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 @@
         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):

Modified: branches/trac285/src/lib/python/isc/config/ccsession.py
==============================================================================
--- branches/trac285/src/lib/python/isc/config/ccsession.py (original)
+++ branches/trac285/src/lib/python/isc/config/ccsession.py Thu Jul  8 14:47:16 2010
@@ -323,6 +323,10 @@
         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"""
@@ -330,6 +334,7 @@
         if 'version' not in config or config['version'] != 1:
             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




More information about the bind10-changes mailing list