Merge "Check vif_type if supported in kuryr"
This commit is contained in:
commit
a51358cade
kuryr
@ -145,6 +145,11 @@ def port_bind(endpoint_id, neutron_port, neutron_subnets):
|
||||
vif_type = neutron_port.get(VIF_TYPE_KEY, FALLBACK_VIF_TYPE)
|
||||
vif_details = utils.string_mappings(neutron_port.get(VIF_DETAILS_KEY))
|
||||
binding_exec_path = os.path.join(config.CONF.bindir, vif_type)
|
||||
if not os.path.exists(binding_exec_path):
|
||||
cleanup_veth(ifname)
|
||||
raise exceptions.BindingNotSupportedFailure(
|
||||
"vif_type({0}) is not supported. A binding script for "
|
||||
"this type can't be found.".format(vif_type))
|
||||
port_id = neutron_port['id']
|
||||
network_id = neutron_port['network_id']
|
||||
tenant_id = neutron_port['tenant_id']
|
||||
|
@ -23,6 +23,14 @@ class BindingFailure(KuryrException):
|
||||
"""
|
||||
|
||||
|
||||
class BindingNotSupportedFailure(KuryrException):
|
||||
"""Exception represents the vif type binding not support.
|
||||
|
||||
This exception is thrown when the executable script for the binding does
|
||||
not exist and Kuryr can't proceed further.
|
||||
"""
|
||||
|
||||
|
||||
class DuplicatedResourceException(KuryrException):
|
||||
"""Exception represents there're multiple resources for the ID.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user