Floating ip filter has no effect

the API of tenant_floating_ip_list add '**search_opts',

Change-Id: Ie4f47f768909a2af7a916d2ad6ce43b3e157b432
Closes-Bug: #1763280
This commit is contained in:
pengyuesheng 2018-04-12 16:02:01 +08:00
parent 35ac8aac77
commit 797859beb7
3 changed files with 9 additions and 4 deletions

View File

@ -1595,8 +1595,9 @@ def floating_ip_pools_list(request):
@memoized
def tenant_floating_ip_list(request, all_tenants=False):
return FloatingIpManager(request).list(all_tenants=all_tenants)
def tenant_floating_ip_list(request, all_tenants=False, **search_opts):
return FloatingIpManager(request).list(all_tenants=all_tenants,
**search_opts)
def tenant_floating_ip_get(request, floating_ip_id):

View File

@ -64,10 +64,12 @@ class IndexView(tables.DataTableView):
@memoized.memoized_method
def get_data(self):
floating_ips = []
search_opts = self.get_filters()
try:
floating_ips = api.neutron.tenant_floating_ip_list(
self.request,
all_tenants=True)
all_tenants=True,
**search_opts)
except Exception:
exceptions.handle(self.request,
_('Unable to retrieve floating IP list.'))

View File

@ -89,7 +89,9 @@ class IndexView(tables.DataTableView):
def get_data(self):
try:
floating_ips = api.neutron.tenant_floating_ip_list(self.request)
search_opts = self.get_filters()
floating_ips = api.neutron.tenant_floating_ip_list(self.request,
**search_opts)
except neutron_exc.ConnectionFailed:
floating_ips = []
exceptions.handle(self.request)