diff --git a/neutron/common/ipv6_utils.py b/neutron/common/ipv6_utils.py index 6e57bfcfe..fbe61e49b 100644 --- a/neutron/common/ipv6_utils.py +++ b/neutron/common/ipv6_utils.py @@ -30,7 +30,7 @@ def get_ipv6_addr_by_EUI64(prefix, mac): eui64 = int(netaddr.EUI(mac).eui64()) prefix = netaddr.IPNetwork(prefix) return netaddr.IPAddress(prefix.first + eui64 ^ (1 << 57)) - except netaddr.AddrFormatError: + except (ValueError, netaddr.AddrFormatError): raise TypeError(_('Bad prefix or mac format for generating IPv6 ' 'address by EUI-64: %(prefix)s, %(mac)s:') % {'prefix': prefix, 'mac': mac}) diff --git a/neutron/plugins/cisco/n1kv/n1kv_client.py b/neutron/plugins/cisco/n1kv/n1kv_client.py index 662199df3..6164d9638 100644 --- a/neutron/plugins/cisco/n1kv/n1kv_client.py +++ b/neutron/plugins/cisco/n1kv/n1kv_client.py @@ -321,7 +321,7 @@ class Client(object): ip = netaddr.IPNetwork(subnet['cidr']) netmask = str(ip.netmask) network_address = str(ip.network) - except netaddr.AddrFormatError: + except (ValueError, netaddr.AddrFormatError): msg = _("Invalid input for CIDR") raise n_exc.InvalidInput(error_message=msg) else: