[svn] commit: r2910 - /branches/trac191-rebased/src/lib/python/isc/config/module_spec.py

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Sep 14 10:13:09 UTC 2010


Author: jelte
Date: Tue Sep 14 10:13:09 2010
New Revision: 2910

Log:
minor patch to fix a bad check in ModuleSpec._validate_spec
(this module contains a command with 1 optional argument; if that argument is left out the _validate_spec item receives a None object over which it tried to iterate; this patch adds a check to see if it is supplied when optional)

Modified:
    branches/trac191-rebased/src/lib/python/isc/config/module_spec.py

Modified: branches/trac191-rebased/src/lib/python/isc/config/module_spec.py
==============================================================================
--- branches/trac191-rebased/src/lib/python/isc/config/module_spec.py (original)
+++ branches/trac191-rebased/src/lib/python/isc/config/module_spec.py Tue Sep 14 10:13:09 2010
@@ -316,7 +316,9 @@
     item_name = spec['item_name']
     item_optional = spec['item_optional']
 
-    if item_name in data:
+    if not data and item_optional:
+        return True
+    elif item_name in data:
         return _validate_item(spec, full, data[item_name], errors)
     elif full and not item_optional:
         if errors != None:




More information about the bind10-changes mailing list