[svn] commit: r486 - /branches/parkinglot/src/lib/cc/python/ISC/CC/data.py

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jan 20 10:27:27 UTC 2010


Author: jelte
Date: Wed Jan 20 10:27:27 2010
New Revision: 486

Log:
check on config add/remove if the given identifier actually leads to a list

Modified:
    branches/parkinglot/src/lib/cc/python/ISC/CC/data.py

Modified: branches/parkinglot/src/lib/cc/python/ISC/CC/data.py
==============================================================================
--- branches/parkinglot/src/lib/cc/python/ISC/CC/data.py (original)
+++ branches/parkinglot/src/lib/cc/python/ISC/CC/data.py Wed Jan 20 10:27:27 2010
@@ -330,6 +330,8 @@
 
     def add(self, identifier, value_str):
         data_spec = find_spec(self.config.specification, identifier)
+        if (type(data_spec) != dict or "list_item_spec" not in data_spec):
+            raise DataTypeError(identifier + " is not a list")
         value = parse_value_str(value_str)
         check_type(data_spec, [value])
         cur_list = find_no_exc(self.config_changes, identifier)
@@ -343,6 +345,8 @@
 
     def remove(self, identifier, value_str):
         data_spec = find_spec(self.config.specification, identifier)
+        if (type(data_spec) != dict or "list_item_spec" not in data_spec):
+            raise DataTypeError(identifier + " is not a list")
         value = parse_value_str(value_str)
         check_type(data_spec, [value])
         cur_list = find_no_exc(self.config_changes, identifier)




More information about the bind10-changes mailing list