BIND 10 trac1843, updated. bed1681e323f5c278a4271b7c948a44b0605e73b [1843] add test for change to find_spec_part

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Apr 19 13:26:43 UTC 2012


The branch, trac1843 has been updated
       via  bed1681e323f5c278a4271b7c948a44b0605e73b (commit)
      from  53a7c709b06e670dacf81907a7360ea030341b1d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bed1681e323f5c278a4271b7c948a44b0605e73b
Author: Jelte Jansen <jelte at isc.org>
Date:   Thu Apr 19 15:26:22 2012 +0200

    [1843] add test for change to find_spec_part
    
    and a bit of comment cleanup

-----------------------------------------------------------------------

Summary of changes:
 src/bin/bindctl/bindcmd.py                         |    4 ++--
 src/lib/python/isc/config/ccsession.py             |    1 -
 .../python/isc/config/tests/config_data_test.py    |    4 ++++
 3 files changed, 6 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/bindctl/bindcmd.py b/src/bin/bindctl/bindcmd.py
index 8952158..35ab5b3 100644
--- a/src/bin/bindctl/bindcmd.py
+++ b/src/bin/bindctl/bindcmd.py
@@ -781,8 +781,8 @@ class BindCmdInterpreter(Cmd):
            The execution is stopped if there are any errors.
         '''
         verbose = False
-        # TODO: revert local changes on failure
-        # make sure it's a copy
+        # Keep a copy of the original local changes, in case the
+        # given command set changes things but fails later
         local_changes_backup =\
             copy.deepcopy(self.config_data.get_local_changes())
         try:
diff --git a/src/lib/python/isc/config/ccsession.py b/src/lib/python/isc/config/ccsession.py
index 84d3319..703d196 100644
--- a/src/lib/python/isc/config/ccsession.py
+++ b/src/lib/python/isc/config/ccsession.py
@@ -559,7 +559,6 @@ class UIModuleCCSession(MultiConfigData):
                                                           " already in " +
                                                           identifier)
 
-
     def add_value(self, identifier, value_str = None, set_value_str = None):
         """Add a value to a configuration list. Raises a DataTypeError
            if the value does not conform to the list_item_spec field
diff --git a/src/lib/python/isc/config/tests/config_data_test.py b/src/lib/python/isc/config/tests/config_data_test.py
index c295c76..cea452b 100644
--- a/src/lib/python/isc/config/tests/config_data_test.py
+++ b/src/lib/python/isc/config/tests/config_data_test.py
@@ -186,6 +186,10 @@ class TestConfigData(unittest.TestCase):
         spec_part = find_spec_part(config_spec, "item6/value1")
         self.assertEqual({'item_name': 'value1', 'item_type': 'string', 'item_optional': True, 'item_default': 'default'}, spec_part)
 
+        # make sure the returned data is a copy
+        spec_part['item_default'] = 'foo'
+        self.assertNotEqual(spec_part, find_spec_part(config_spec, "item6/value1"))
+
     def test_find_spec_part_lists(self):
         # A few specific tests for list data
         module_spec = isc.config.module_spec_from_file(self.data_path +



More information about the bind10-changes mailing list