summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Bragstad <lbragstad@gmail.com>2017-08-08 20:37:10 +0000
committerLance Bragstad <lbragstad@gmail.com>2017-08-09 14:10:45 +0000
commit9fccd38d1b177664c64bbf987a8c31d06d7cfc60 (patch)
treeb5af75fdae9efccadf484e63078f0cc58bbdfbd1
parent86b4b4a74717ed0e89f65cbca8683ea117bd9f19 (diff)
downloadkeystone-9fccd38d1b177664c64bbf987a8c31d06d7cfc60.tar.gz
Remove unused hints from assignment APIs
The controller is responsible for listing user projects based on role assignments and would build a hints objects and pass it to the assignment manager. This is a common pattern used across keystone's APIs. But, the assignment API never actually passed the hints objects to the backend implementation. This commit removes the hints from being passed to the manager for list_projects_for_user and list_domains_for_user because those APIs never use the hints object. This should allow us to implement caching to speed up those calls later. Change-Id: I9b1c8c30ca6a78dd6e78add7de278e467ceea046 Related-Bug: 1700852
-rw-r--r--keystone/assignment/controllers.py3
-rw-r--r--keystone/assignment/core.py4
2 files changed, 3 insertions, 4 deletions
diff --git a/keystone/assignment/controllers.py b/keystone/assignment/controllers.py
index 3137e2a60..845744d1f 100644
--- a/keystone/assignment/controllers.py
+++ b/keystone/assignment/controllers.py
@@ -266,8 +266,7 @@ class ProjectAssignmentV3(controller.V3Controller):
@controller.filterprotected('domain_id', 'enabled', 'name')
def list_user_projects(self, request, filters, user_id):
hints = ProjectAssignmentV3.build_driver_hints(request, filters)
- refs = self.assignment_api.list_projects_for_user(user_id,
- hints=hints)
+ refs = self.assignment_api.list_projects_for_user(user_id)
return ProjectAssignmentV3.wrap_collection(request.context_dict,
refs,
hints=hints)
diff --git a/keystone/assignment/core.py b/keystone/assignment/core.py
index a816222db..6db4d3209 100644
--- a/keystone/assignment/core.py
+++ b/keystone/assignment/core.py
@@ -223,7 +223,7 @@ class Manager(manager.Manager):
# TODO(henry-nash): We might want to consider list limiting this at some
# point in the future.
- def list_projects_for_user(self, user_id, hints=None):
+ def list_projects_for_user(self, user_id):
assignment_list = self.list_role_assignments(
user_id=user_id, effective=True)
# Use set() to process the list to remove any duplicates
@@ -233,7 +233,7 @@ class Manager(manager.Manager):
# TODO(henry-nash): We might want to consider list limiting this at some
# point in the future.
- def list_domains_for_user(self, user_id, hints=None):
+ def list_domains_for_user(self, user_id):
assignment_list = self.list_role_assignments(
user_id=user_id, effective=True)
# Use set() to process the list to remove any duplicates