From 3a1c0daab4a60b0aca07a4842f92a477994abcbd Mon Sep 17 00:00:00 2001 From: Abhishek Raut Date: Wed, 7 Sep 2016 01:05:27 -0700 Subject: [PATCH] [NSXv3]: get_floatingips filter must pass a list of ports Filters accept list of ports in the query instead of a single port id. This led to get_floatingips returning empty list even if a floating ip exists for a given port. This patch removes the redundant get_floatingips method and passes a list instead of a single item in TaaS driver. Change-Id: I349f9ad16edb4e5069c70d209ccd7537f59620ec --- vmware_nsx/plugins/nsx_v3/plugin.py | 12 ------------ vmware_nsx/services/neutron_taas/nsx_v3/driver.py | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index b86b5256e1..0cefe823eb 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -2601,18 +2601,6 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, if floatingip['floatingip']['port_id'] else const.FLOATINGIP_STATUS_DOWN)) - def get_floatingips(self, context, filters=None, fields=None, - sorts=None, limit=None, marker=None, - page_reverse=False): - #NOTE(abhiraut): Although this method does not do anything fancy - # we have defined it here so that TaaS driver - # can retrieve floating IP for a particular port ID - # using filters. - return super(NsxV3Plugin, self).get_floatingips( - context, filters=filters, fields=fields, - sorts=sorts, limit=limit, marker=marker, - page_reverse=page_reverse) - def create_floatingip(self, context, floatingip): new_fip = self._create_floating_ip_wrapper(context, floatingip) router_id = new_fip['router_id'] diff --git a/vmware_nsx/services/neutron_taas/nsx_v3/driver.py b/vmware_nsx/services/neutron_taas/nsx_v3/driver.py index 724170b149..3b9a2dac5b 100644 --- a/vmware_nsx/services/neutron_taas/nsx_v3/driver.py +++ b/vmware_nsx/services/neutron_taas/nsx_v3/driver.py @@ -198,7 +198,7 @@ class NsxV3Driver(base_driver.TaasBaseDriver, # Verify whether destination port is L3 reachable. i.e. destination # port has a floating IP address. fips = self._nsx_plugin.get_floatingips( - context._plugin_context, filters={'port_id': dest_port_id}) + context._plugin_context, filters={'port_id': [dest_port_id]}) if not fips: msg = (_("Destination port %s must have a floating IP for " "L3 SPAN") % dest_port_id)