+ def verify(self, default, read, verify_variables={}):
+ """ Confirm that the existing configuration is consistent
+ according to the checks below.
+
+ It looks for filled-in values in the order of, local object (self),
+ followed by cread (read values), and finally default values.
+
+ Arguments:
+
+ default configuration
+ site configuration
+ list of category/variable tuples to validate in these configurations
+
+ Returns:
+
+ dict of values for the category/variables passed in
+ If an exception is found, ConfigurationException is raised.
+
+ """
+
+ validated_variables = {}
+ for category_id, variable_id in verify_variables.iteritems():
+ category_id = category_id.lower()
+ variable_id = variable_id.lower()
+ variable_value = None
+ sources = (self, read, default)
+ for source in sources:
+ (category_value, variable_value) = source.get(category_id,variable_id)
+ if variable_value <> None:
+ entry = validated_variables.get(category_id,[])
+ entry.append(variable_value['value'])
+ validated_variables["%s_%s"%(category_id.upper(),variable_id.upper())]=entry
+ break
+ if variable_value == None:
+ raise ConfigurationException("Cannot find %s_%s)" % \
+ (category_id.upper(),
+ variable_id.upper()))
+ return validated_variables