TVD: ensure that get ports does not throw exception

V3 port retrieval is different from the V and DVS. We add in a
valdiation here that the method exists.

Change-Id: I4deb3a5f0066faeac81a338506ecfdcc56a72a95
This commit is contained in:
Gary Kotton 2017-12-17 23:25:56 -08:00
parent 792a6a0103
commit 619f337d57

View File

@ -271,7 +271,8 @@ class NsxTVDPlugin(addr_pair_db.AllowedAddressPairsMixin,
port_model = self._get_port(context, port['id'])
resource_extend.apply_funcs('ports', port, port_model)
p = self._get_plugin_from_net_id(context, port['network_id'])
p._extend_get_port_dict_qos_and_binding(context, port)
if hasattr(p, '_extend_get_port_dict_qos_and_binding'):
p._extend_get_port_dict_qos_and_binding(context, port)
p._remove_provider_security_groups_from_list(port)
return (ports if not fields else
[db_utils.resource_fields(port, fields) for port in ports])