[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
This commit is contained in:
Abhishek Raut 2016-09-07 01:05:27 -07:00
parent c48a13a77d
commit 3a1c0daab4
2 changed files with 1 additions and 13 deletions

View File

@ -2601,18 +2601,6 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
if floatingip['floatingip']['port_id'] if floatingip['floatingip']['port_id']
else const.FLOATINGIP_STATUS_DOWN)) 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): def create_floatingip(self, context, floatingip):
new_fip = self._create_floating_ip_wrapper(context, floatingip) new_fip = self._create_floating_ip_wrapper(context, floatingip)
router_id = new_fip['router_id'] router_id = new_fip['router_id']

View File

@ -198,7 +198,7 @@ class NsxV3Driver(base_driver.TaasBaseDriver,
# Verify whether destination port is L3 reachable. i.e. destination # Verify whether destination port is L3 reachable. i.e. destination
# port has a floating IP address. # port has a floating IP address.
fips = self._nsx_plugin.get_floatingips( 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: if not fips:
msg = (_("Destination port %s must have a floating IP for " msg = (_("Destination port %s must have a floating IP for "
"L3 SPAN") % dest_port_id) "L3 SPAN") % dest_port_id)