]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Clean up quantum.api.v2.validators
authorZhongyue Luo <zhongyue.nah@intel.com>
Fri, 9 Nov 2012 03:49:04 +0000 (11:49 +0800)
committerZhongyue Luo <zhongyue.nah@intel.com>
Fri, 9 Nov 2012 08:18:33 +0000 (16:18 +0800)
Remove redundant declarations
Sort validators by lexographical order

Change-Id: I9a55a55a28702bba38615bad192f6f80706eec7c

quantum/api/v2/attributes.py

index db9edcac3f17211ed6fe5d61393e5a9043e08156..9076657630aa636fa83abd2e92ac749c4162634d 100644 (file)
@@ -326,22 +326,19 @@ MAC_PATTERN = "^%s[aceACE02468](:%s{2}){5}$" % (HEX_ELEM, HEX_ELEM)
 
 # Dictionary that maintains a list of validation functions
 validators = {'type:boolean': _validate_boolean,
-              'type:values': _validate_values,
-              'type:string': _validate_string,
-              'type:range': _validate_range,
-              'type:mac_address': _validate_mac_address,
               'type:fixed_ips': _validate_fixed_ips,
+              'type:hostroutes': _validate_hostroutes,
               'type:ip_address': _validate_ip_address,
               'type:ip_address_or_none': _validate_ip_address_or_none,
+              'type:ip_pools': _validate_ip_pools,
               'type:mac_address': _validate_mac_address,
+              'type:nameservers': _validate_nameservers,
               'type:range': _validate_range,
               'type:regex': _validate_regex,
+              'type:string': _validate_string,
               'type:subnet': _validate_subnet,
               'type:uuid': _validate_uuid,
-              'type:regex': _validate_regex,
-              'type:ip_pools': _validate_ip_pools,
-              'type:hostroutes': _validate_hostroutes,
-              'type:nameservers': _validate_nameservers}
+              'type:values': _validate_values}
 
 # Note: a default of ATTR_NOT_SPECIFIED indicates that an
 # attribute is not required, but will be generated by the plugin