Skip to content

Commit

Permalink
Floating ip filter has no effect
Browse files Browse the repository at this point in the history
the API of tenant_floating_ip_list add '**search_opts',

Change-Id: Ie4f47f768909a2af7a916d2ad6ce43b3e157b432
Closes-Bug: #1763280
  • Loading branch information
pengyuesheng committed Aug 23, 2018
1 parent 35ac8aa commit 797859b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions openstack_dashboard/api/neutron.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion openstack_dashboard/dashboards/admin/floating_ips/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.'))
Expand Down
4 changes: 3 additions & 1 deletion openstack_dashboard/dashboards/project/floating_ips/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 797859b

Please sign in to comment.