Fix port_hardware_offload_type ML2 extension
This patch fixes 2 issues related to that port_hardware_offload_type extension: 1. API extension is now not supported by the ML2 plugin directly so if ml2 extension is not loaded Neutron will not report that API extension is available, 2. Fix error 500 when creating port with hardware_offload_type attribute set but when binding:profile is not set (is of type Sentinel). Closes-bug: #2078432 Closes-bug: #2078434 Change-Id: Ib0038dd39d8d210104ee8a70e4519124f09292da
This commit is contained in:
parent
d73cc2eff6
commit
fbb7c9ae3d
neutron
@ -41,7 +41,7 @@ class PortHardwareOffloadTypeDbMixin(object):
|
||||
if hw_type not in capabilities:
|
||||
capabilities.append(hw_type)
|
||||
data[portbindings.PROFILE]['capabilities'] = capabilities
|
||||
except KeyError:
|
||||
except (AttributeError, KeyError):
|
||||
data[portbindings.PROFILE] = {'capabilities': [hw_type]}
|
||||
|
||||
def _extend_port_dict(self, port_db, result):
|
||||
|
@ -43,7 +43,6 @@ from neutron_lib.api.definitions import network_mtu as mtu_apidef
|
||||
from neutron_lib.api.definitions import network_mtu_writable as mtuw_apidef
|
||||
from neutron_lib.api.definitions import port as port_def
|
||||
from neutron_lib.api.definitions import port_device_profile as pdp_def
|
||||
from neutron_lib.api.definitions import port_hardware_offload_type as phot_def
|
||||
from neutron_lib.api.definitions import port_mac_address_override
|
||||
from neutron_lib.api.definitions import port_mac_address_regenerate
|
||||
from neutron_lib.api.definitions import port_numa_affinity_policy as pnap_def
|
||||
@ -251,7 +250,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
port_mac_address_override.ALIAS,
|
||||
sg_default_rules_ext.ALIAS,
|
||||
sg_rules_default_sg.ALIAS,
|
||||
phot_def.ALIAS,
|
||||
subnet_ext_net_def.ALIAS,
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user