netaddr<=0.7.10 raises ValueError instead of AddrFormatError

This patch ensures that ValueError is also caught in addition to
AddrFormatError as in netaddr>=0.7.11 AddrFormatError is raised and
in netaddr<=0.7.10 ValueError is raised.

Change-Id: I595c90e42129a2d365f3860e3042e826bd031365
Closes-bug: #1308675
changes/52/88052/2
Aaron Rosen 9 years ago committed by Gerrit Code Review
parent c049583e80
commit dd2ccd12ad
  1. 2
      neutron/extensions/securitygroup.py

@ -167,7 +167,7 @@ def convert_ip_prefix_to_cidr(ip_prefix):
try:
cidr = netaddr.IPNetwork(ip_prefix)
return str(cidr)
except (TypeError, netaddr.AddrFormatError):
except (ValueError, TypeError, netaddr.AddrFormatError):
raise qexception.InvalidCIDR(input=ip_prefix)

Loading…
Cancel
Save