[svn] commit: r4121 - in /trunk/src/lib/python/isc/config: module_spec.py tests/module_spec_test.py
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jan 3 09:35:36 UTC 2011
Author: jelte
Date: Mon Jan 3 09:35:36 2011
New Revision: 4121
Log:
Fix for a small problem mentioned on jabber for commands that have no arguments (where validation failed after the merge of ticket #202)
Patch also discussed on jabber, no separate ticket
Modified:
trunk/src/lib/python/isc/config/module_spec.py
trunk/src/lib/python/isc/config/tests/module_spec_test.py
Modified: trunk/src/lib/python/isc/config/module_spec.py
==============================================================================
--- trunk/src/lib/python/isc/config/module_spec.py (original)
+++ trunk/src/lib/python/isc/config/module_spec.py Mon Jan 3 09:35:36 2011
@@ -339,13 +339,14 @@
# check if there are items in our data that are not in the
# specification
- for item_name in data:
- found = False
- for spec_item in module_spec:
- if spec_item["item_name"] == item_name:
- found = True
- if not found:
- if errors != None:
- errors.append("unknown item " + item_name)
- validated = False
+ if data is not None:
+ for item_name in data:
+ found = False
+ for spec_item in module_spec:
+ if spec_item["item_name"] == item_name:
+ found = True
+ if not found:
+ if errors != None:
+ errors.append("unknown item " + item_name)
+ validated = False
return validated
Modified: trunk/src/lib/python/isc/config/tests/module_spec_test.py
==============================================================================
--- trunk/src/lib/python/isc/config/tests/module_spec_test.py (original)
+++ trunk/src/lib/python/isc/config/tests/module_spec_test.py Mon Jan 3 09:35:36 2011
@@ -321,6 +321,7 @@
}]
errors = []
+ self.assertEqual(True, isc.config.module_spec._validate_spec_list(spec, True, None, None))
self.assertEqual(False, isc.config.module_spec._validate_spec_list(spec, True, { 'does_not_exist': 1 }, None))
self.assertEqual(False, isc.config.module_spec._validate_spec_list(spec, True, { 'does_not_exist': 1 }, errors))
self.assertEqual(['unknown item does_not_exist'], errors)
More information about the bind10-changes
mailing list