- for key, value in params.iteritems():
- fullkey = "ipolicy/" + key
- _helper(owner, fullkey, value, constants.ISPECS_PARAMETER_TYPES)
+ for key, value in params.items():
+ if key in constants.IPOLICY_ISPECS:
+ fullkey = "ipolicy/" + key
+ _helper(owner, fullkey, value, constants.ISPECS_PARAMETER_TYPES)
+ else:
+ # FIXME: assuming list type
+ if key in constants.IPOLICY_PARAMETERS:
+ exp_type = float
+ else:
+ exp_type = list
+ if not isinstance(value, exp_type):
+ result.append("%s has invalid instance policy: for %s,"
+ " expecting %s, got %s" %
+ (owner, key, exp_type.__name__, type(value)))