Skip to content

Commit

Permalink
Fetch only routers in project of context['tenant_id'] when non-admin
Browse files Browse the repository at this point in the history
is requesting router-list without filters.

Change-Id: Ibb48aede78f336bf4301d08f126d28e2fab2d68a
Closes-Bug: 1596722
(cherry picked from commit 51c6303)
(cherry picked from commit 9c9791f)
  • Loading branch information
Hampapur Ajay committed Jun 29, 2016
1 parent c82a4c2 commit c189b53
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3166,9 +3166,14 @@ def router_list(self, context=None, filters=None):
except NoIdError:
pass
else:
# read all routers in all projects
project_rtrs = self._router_list_project()
all_rtrs.append(project_rtrs)
if not context['is_admin']:
project_id = str(uuid.UUID(context['tenant']))
else:
project_id = None

# read all routers in specified projects
project_rtrs = self._router_list_project(project_id=project_id)
all_rtrs.append(project_rtrs)

# prune phase
for project_rtrs in all_rtrs:
Expand Down

0 comments on commit c189b53

Please sign in to comment.