BIND 10 master, updated. 653847cf994c75cacd23df1ae0e5c9002cf338c4 [master] update changelog for merge of #1520
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed May 2 14:46:38 UTC 2012
The branch, master has been updated
via 653847cf994c75cacd23df1ae0e5c9002cf338c4 (commit)
via 0f18039bc751a8f498c1f832196e2ecc7b997b2a (commit)
via 17f72c2e942afec37711c9b05c4a5351f40b4676 (commit)
from c73ffa69fd26e03b0879a7773f7f6796f19aee2e (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 653847cf994c75cacd23df1ae0e5c9002cf338c4
Author: Jelte Jansen <jelte at isc.org>
Date: Wed May 2 16:46:20 2012 +0200
[master] update changelog for merge of #1520
commit 0f18039bc751a8f498c1f832196e2ecc7b997b2a
Merge: c73ffa69fd26e03b0879a7773f7f6796f19aee2e 17f72c2e942afec37711c9b05c4a5351f40b4676
Author: Jelte Jansen <jelte at isc.org>
Date: Wed May 2 16:42:10 2012 +0200
[master] Merge branch 'trac1520'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
src/lib/python/isc/config/config_data.py | 4 +++-
.../python/isc/config/tests/config_data_test.py | 6 ++++--
3 files changed, 12 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index a456635..21268c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+430. [bug] jelte
+ When displaying configuration data, bindctl no longer treats
+ optional list items as an error, but shows them as an empty list.
+ (Trac #1520, git 0f18039bc751a8f498c1f832196e2ecc7b997b2a)
+
429. [func] jelte
Added an 'execute' component to bindctl, which executes either a set
of commands from a file or a built-in set of commands. Currently,
diff --git a/src/lib/python/isc/config/config_data.py b/src/lib/python/isc/config/config_data.py
index b7adef8..2bec4ab 100644
--- a/src/lib/python/isc/config/config_data.py
+++ b/src/lib/python/isc/config/config_data.py
@@ -589,8 +589,10 @@ class MultiConfigData:
if item_type == "list" and (all or first):
spec_part_list = spec_part['list_item_spec']
list_value, status = self.get_value(identifier)
+ # If not set, and no default, lists will show up as 'None',
+ # but it's better to treat it as an empty list then
if list_value is None:
- raise isc.cc.data.DataNotFoundError(identifier + " not found")
+ list_value = []
if type(list_value) != list:
# the identifier specified a single element
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 cea452b..221ffa6 100644
--- a/src/lib/python/isc/config/tests/config_data_test.py
+++ b/src/lib/python/isc/config/tests/config_data_test.py
@@ -596,8 +596,10 @@ class TestMultiConfigData(unittest.TestCase):
module_spec = isc.config.module_spec_from_file(self.data_path + os.sep + "spec24.spec")
self.mcd.set_specification(module_spec)
- self.assertRaises(isc.cc.data.DataNotFoundError,
- self.mcd.get_value_maps, "/Spec24/item", 4)
+ # optional list item that is not set should return as empty list
+ maps = self.mcd.get_value_maps("/Spec24/item", 4)
+ self.assertEqual([{'default': False, 'type': 'list', 'name': 'Spec24/item', 'value': [], 'modified': False}], maps)
+
self.mcd._set_current_config({ "Spec24": { "item": [] } })
maps = self.mcd.get_value_maps("/Spec24/item")
self.assertEqual([{'default': False, 'modified': False, 'name': 'Spec24/item', 'type': 'list', 'value': []}], maps)
More information about the bind10-changes
mailing list