BIND 10 master, updated. 24ec2f1431f588dac255930a6cac73519b4fa4ea Changelog for #1515

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jan 6 09:32:30 UTC 2012


The branch, master has been updated
       via  24ec2f1431f588dac255930a6cac73519b4fa4ea (commit)
       via  a3cf5322a73e8a97b388c6f8025b92957e5d8986 (commit)
       via  0d120aa641cdb7fe66b04cb80974e3994d8c0251 (commit)
       via  7b92b4d81235e99cbb210e427a8a56d44a1e9998 (commit)
       via  fb6cd6d5a9cb93c5e2e6f274919c16c2348eead2 (commit)
       via  ff1a0cd96fd213256d1e91c21cca3de2be634314 (commit)
      from  55982f5001add9a6da88b65ff543034a19b37b2b (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 24ec2f1431f588dac255930a6cac73519b4fa4ea
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Fri Jan 6 10:31:36 2012 +0100

    Changelog for #1515

commit a3cf5322a73e8a97b388c6f8025b92957e5d8986
Merge: 55982f5001add9a6da88b65ff543034a19b37b2b 0d120aa641cdb7fe66b04cb80974e3994d8c0251
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Fri Jan 6 09:52:20 2012 +0100

    Merge #1515

commit 0d120aa641cdb7fe66b04cb80974e3994d8c0251
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Wed Jan 4 20:19:18 2012 +0100

    [1515] Fix Makefile.am
    
    It was missing an EXTRA_DIST entry to supply the test spec data

commit 7b92b4d81235e99cbb210e427a8a56d44a1e9998
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Wed Jan 4 20:07:51 2012 +0100

    [1515] Remove duplicate line

commit fb6cd6d5a9cb93c5e2e6f274919c16c2348eead2
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Wed Dec 28 15:36:16 2011 +0100

    [1515] Make sure the same error is not in named_set

commit ff1a0cd96fd213256d1e91c21cca3de2be634314
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Wed Dec 28 15:30:30 2011 +0100

    [1515] Don't crash when printing exception
    
    The thing should be converted to string properly

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

Summary of changes:
 ChangeLog                                         |    5 +++++
 src/lib/config/tests/testdata/Makefile.am         |    1 +
 src/lib/config/tests/testdata/spec39.spec         |   21 +++++++++++++++++++++
 src/lib/python/isc/config/ccsession.py            |    4 ++--
 src/lib/python/isc/config/tests/ccsession_test.py |   16 ++++++++++++++++
 5 files changed, 45 insertions(+), 2 deletions(-)
 create mode 100644 src/lib/config/tests/testdata/spec39.spec

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index a1bfb8a..75e328e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+360.	[bug]		vorner
+	Fixed problem where bindctl crashed when a duplicate non-string
+	item was added  to a list.  This error is now properly reported.
+	(Trac #1515, git a3cf5322a73e8a97b388c6f8025b92957e5d8986)
+
 359.	[bug]		kevin
 	Corrected SOA serial check in xfrout.  It now compares the SOA
 	serial of an IXFR query with that of the server based serial
diff --git a/src/lib/config/tests/testdata/Makefile.am b/src/lib/config/tests/testdata/Makefile.am
index 0d8b92e..1bf9496 100644
--- a/src/lib/config/tests/testdata/Makefile.am
+++ b/src/lib/config/tests/testdata/Makefile.am
@@ -65,3 +65,4 @@ EXTRA_DIST += spec35.spec
 EXTRA_DIST += spec36.spec
 EXTRA_DIST += spec37.spec
 EXTRA_DIST += spec38.spec
+EXTRA_DIST += spec39.spec
diff --git a/src/lib/config/tests/testdata/spec39.spec b/src/lib/config/tests/testdata/spec39.spec
new file mode 100644
index 0000000..1f72319
--- /dev/null
+++ b/src/lib/config/tests/testdata/spec39.spec
@@ -0,0 +1,21 @@
+{
+  "module_spec": {
+    "module_name": "Spec39",
+    "config_data": [
+      { "item_name": "list",
+        "item_type": "list",
+        "item_optional": false,
+        "item_default": [],
+        "list_item_spec": {
+          "item_name": "list_item",
+          "item_type": "boolean",
+          "item_optional": false,
+          "item_default": false
+        }
+      }
+    ],
+    "commands": [],
+    "statistics": []
+  }
+}
+
diff --git a/src/lib/python/isc/config/ccsession.py b/src/lib/python/isc/config/ccsession.py
index 2d998ce..760ae55 100644
--- a/src/lib/python/isc/config/ccsession.py
+++ b/src/lib/python/isc/config/ccsession.py
@@ -451,9 +451,9 @@ class UIModuleCCSession(MultiConfigData):
             cur_list.append(value)
             self.set_value(identifier, cur_list)
         else:
-            raise isc.cc.data.DataAlreadyPresentError(value +
+            raise isc.cc.data.DataAlreadyPresentError(str(value) +
                                                       " already in "
-                                                      + identifier)
+                                                      + str(identifier))
 
     def _add_value_to_named_set(self, identifier, value, item_value):
         if type(value) != str:
diff --git a/src/lib/python/isc/config/tests/ccsession_test.py b/src/lib/python/isc/config/tests/ccsession_test.py
index 8d616e2..7bd4476 100644
--- a/src/lib/python/isc/config/tests/ccsession_test.py
+++ b/src/lib/python/isc/config/tests/ccsession_test.py
@@ -701,6 +701,12 @@ class TestUIModuleCCSession(unittest.TestCase):
         fake_conn.set_get_answer('/config_data', { 'version': BIND10_CONFIG_DATA_VERSION })
         return UIModuleCCSession(fake_conn)
 
+    def create_uccs_listtest(self, fake_conn):
+        module_spec = isc.config.module_spec_from_file(self.spec_file("spec39.spec"))
+        fake_conn.set_get_answer('/module_spec', { module_spec.get_module_name(): module_spec.get_full_spec()})
+        fake_conn.set_get_answer('/config_data', { 'version': BIND10_CONFIG_DATA_VERSION })
+        return UIModuleCCSession(fake_conn)
+
     def test_init(self):
         fake_conn = fakeUIConn()
         fake_conn.set_get_answer('/module_spec', {})
@@ -751,6 +757,14 @@ class TestUIModuleCCSession(unittest.TestCase):
         self.assertRaises(isc.cc.data.DataTypeError,
                           uccs.remove_value, "Spec2/item5", None)
 
+    def test_add_dup_value(self):
+        fake_conn = fakeUIConn()
+        uccs = self.create_uccs_listtest(fake_conn)
+
+        uccs.add_value("Spec39/list")
+        self.assertRaises(isc.cc.data.DataAlreadyPresentError, uccs.add_value,
+                          "Spec39/list")
+
     def test_add_remove_value_named_set(self):
         fake_conn = fakeUIConn()
         uccs = self.create_uccs_named_set(fake_conn)
@@ -787,6 +801,8 @@ class TestUIModuleCCSession(unittest.TestCase):
         self.assertRaises(isc.cc.data.DataNotFoundError,
                           uccs.remove_value, "/Spec32/named_set_item",
                           "no_such_item")
+        self.assertRaises(isc.cc.data.DataAlreadyPresentError,
+                          uccs.add_value, "/Spec32/named_set_item", "c")
 
     def test_set_value_named_set(self):
         fake_conn = fakeUIConn()




More information about the bind10-changes mailing list