From ffc97c07353690c0ea00d706ecd9e5b7ee48fc1e Mon Sep 17 00:00:00 2001 From: Henry Nash Date: Fri, 4 Sep 2015 06:59:00 +0100 Subject: [PATCH] Rationalize list role assignment routing The v3 role assignment controller was created as a standard controller even though it only supports the list method. This means not only do we have code stubs that are unused, but this will complicate the addition of separate entry points for listing role assignments for a tree in the follow on patch. This patch, therfore, rationalizes the routes so that this is set up for just the list method, and removes the unused code stubs. Implements: bp list-assignment-subtree Change-Id: I0c03accecdcf1608b50ad6b130c8a49d8a9b5b42 --- keystone/assignment/controllers.py | 12 ------------ keystone/assignment/routers.py | 10 +++++----- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/keystone/assignment/controllers.py b/keystone/assignment/controllers.py index 5ca48a78c1..daefc5a540 100644 --- a/keystone/assignment/controllers.py +++ b/keystone/assignment/controllers.py @@ -649,15 +649,3 @@ class RoleAssignmentV3(controller.V3Controller): formatted_refs = [self._format_entity(context, ref) for ref in refs] return self.wrap_collection(context, formatted_refs) - - @controller.protected() - def get_role_assignment(self, context): - raise exception.NotImplemented() - - @controller.protected() - def update_role_assignment(self, context): - raise exception.NotImplemented() - - @controller.protected() - def delete_role_assignment(self, context): - raise exception.NotImplemented() diff --git a/keystone/assignment/routers.py b/keystone/assignment/routers.py index 49549a0b8a..6a91c21bd1 100644 --- a/keystone/assignment/routers.py +++ b/keystone/assignment/routers.py @@ -159,11 +159,11 @@ class Routers(wsgi.RoutersBase): 'group_id': json_home.Parameters.GROUP_ID, }) - routers.append( - router.Router(controllers.RoleAssignmentV3(), - 'role_assignments', 'role_assignment', - resource_descriptions=self.v3_resources, - is_entity_implemented=False)) + self._add_resource( + mapper, controllers.RoleAssignmentV3(), + path='/role_assignments', + get_action='list_role_assignments', + rel=json_home.build_v3_resource_relation('role_assignments')) if CONF.os_inherit.enabled: self._add_resource(