[svn] commit: r2455 - in /branches/trac232: ./ src/bin/bind10/tests/ src/bin/bindctl/ src/bin/cmdctl/ src/bin/xfrin/ src/lib/cc/ src/lib/datasrc/ src/lib/dns/ src/lib/dns/rdata/generic/ src/lib/dns/tests/ src/lib/python/isc/cc/tests/ src/lib/python/isc/config/ src/lib/python/isc/log/ src/lib/xfr/

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jul 9 10:53:10 UTC 2010


Author: jelte
Date: Fri Jul  9 10:53:10 2010
New Revision: 2455

Log:
sync with trunk

Added:
    branches/trac232/src/bin/bind10/tests/args_test.py
      - copied unchanged from r2451, trunk/src/bin/bind10/tests/args_test.py
    branches/trac232/src/bin/cmdctl/cmdctl.spec.pre.in
      - copied unchanged from r2451, trunk/src/bin/cmdctl/cmdctl.spec.pre.in
    branches/trac232/src/lib/datasrc/cache.cc
      - copied unchanged from r2451, trunk/src/lib/datasrc/cache.cc
    branches/trac232/src/lib/datasrc/cache.h
      - copied unchanged from r2451, trunk/src/lib/datasrc/cache.h
    branches/trac232/src/lib/python/isc/cc/tests/message_test.py
      - copied unchanged from r2451, trunk/src/lib/python/isc/cc/tests/message_test.py
    branches/trac232/src/lib/xfr/fdshare_python.cc
      - copied unchanged from r2451, trunk/src/lib/xfr/fdshare_python.cc
Modified:
    branches/trac232/   (props changed)
    branches/trac232/ChangeLog
    branches/trac232/src/bin/bindctl/bindcmd.py
    branches/trac232/src/bin/xfrin/   (props changed)
    branches/trac232/src/lib/cc/   (props changed)
    branches/trac232/src/lib/datasrc/   (props changed)
    branches/trac232/src/lib/dns/   (props changed)
    branches/trac232/src/lib/dns/rdata/generic/rrsig_46.cc   (props changed)
    branches/trac232/src/lib/dns/tests/   (props changed)
    branches/trac232/src/lib/python/isc/config/ccsession.py
    branches/trac232/src/lib/python/isc/log/log.py

Modified: branches/trac232/ChangeLog
==============================================================================
--- branches/trac232/ChangeLog (original)
+++ branches/trac232/ChangeLog Fri Jul  9 10:53:10 2010
@@ -1,3 +1,8 @@
+  73.	[bug]		jelte
+  	Fixed a bug where in bindctl, locally changed settings were
+	reset when the list of running modules is updated. (Trac #285,
+	r2452)
+
   72.	[build]		jinmei
 	Added -R when linking python wrapper modules to libpython when
 	possible.  This helps build BIND 10 on platforms that install

Modified: branches/trac232/src/bin/bindctl/bindcmd.py
==============================================================================
--- branches/trac232/src/bin/bindctl/bindcmd.py (original)
+++ branches/trac232/src/bin/bindctl/bindcmd.py Fri Jul  9 10:53:10 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/trac232/src/lib/python/isc/config/ccsession.py
==============================================================================
--- branches/trac232/src/lib/python/isc/config/ccsession.py (original)
+++ branches/trac232/src/lib/python/isc/config/ccsession.py Fri Jul  9 10:53:10 2010
@@ -325,6 +325,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"""
@@ -332,6 +336,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

Modified: branches/trac232/src/lib/python/isc/log/log.py
==============================================================================
--- branches/trac232/src/lib/python/isc/log/log.py (original)
+++ branches/trac232/src/lib/python/isc/log/log.py Fri Jul  9 10:53:10 2010
@@ -70,7 +70,7 @@
             predetermined log file size
         """
         dir = os.path.split(file_name)
-        if(os.path.exists(dir[0])):
+        if (os.path.exists(dir[0])):
             self.baseFilename = file_name
         self.maxBytes = max_bytes
         self.backupCount = backup_count
@@ -158,7 +158,7 @@
             max_bytes : limit log growth
             backup_count : max backup count
         """
-        if(log_file != 0  and log_file != ''):
+        if (log_file != 0  and log_file != ''):
             try:
                 self._file_handler = NSFileLogHandler(filename = log_file,
                                           maxBytes = max_bytes, backupCount = backup_count)
@@ -194,7 +194,7 @@
         configuration, or add it to the logger.
         """
         if (self._file_handler in self.handlers):
-            if(log_file != 0 and log_file != ''):
+            if (log_file != 0 and log_file != ''):
                 self._file_handler.update_config(log_file, backup_count, max_bytes)
             else:
                 """If log file is empty, the handler will be removed."""
@@ -208,19 +208,19 @@
          """Get config data from module configuration"""
          
          log_file_str = config_data.get('log_file')
-         if(log_file_str):
+         if (log_file_str):
             self._log_file = log_file_str
          
          severity_str = config_data.get('log_severity')
-         if(severity_str):
+         if (severity_str):
              self._severity = severity_str
 
          versions_str = config_data.get('log_versions')
-         if(versions_str):
+         if (versions_str):
              self._versions = int(versions_str)
 
          max_bytes_str = config_data.get('log_max_bytes')
-         if(max_bytes_str):
+         if (max_bytes_str):
              self._max_bytes = int(max_bytes_str)
 
     def update_config(self, config_data):
@@ -231,7 +231,7 @@
         self._get_config(config_data)
 
         logLevel = LEVELS.get(self._severity, logging.NOTSET)
-        if(logLevel != self.getEffectiveLevel()):
+        if (logLevel != self.getEffectiveLevel()):
             self.setLevel(logLevel)
         self._update_rotate_handler(self._log_file, self._versions, self._max_bytes)
 




More information about the bind10-changes mailing list