Random cleanups
Use 'if (' instead of 'if(' Use common util method for validating vlan tags Change-Id: I26401e3d9c10b581793c1e8abcbcdf7a7ea304f0
This commit is contained in:
parent
43a52e0a58
commit
410af60a91
|
@ -537,12 +537,7 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
|
|||
msg = _('Invalid binding:profile. parent_name "%s" must be '
|
||||
'a string.') % parent_name
|
||||
raise n_exc.InvalidInput(error_message=msg)
|
||||
try:
|
||||
# FIXME(arosen): use neutron.plugins.common.utils.is_valid_vlan_tag
|
||||
tag = int(tag)
|
||||
if(tag < 0 or tag > 4095):
|
||||
raise ValueError
|
||||
except ValueError:
|
||||
if not n_utils.is_valid_vlan_tag(tag):
|
||||
msg = _('Invalid binding:profile. tag "%s" must be '
|
||||
'an int between 1 and 4096, inclusive.') % tag
|
||||
raise n_exc.InvalidInput(error_message=msg)
|
||||
|
|
Loading…
Reference in New Issue