From ed9324ee325b48f26a3883f9d43d96df15ed186b Mon Sep 17 00:00:00 2001 From: Samuel de Medeiros Queiroz Date: Sat, 21 Feb 2015 01:22:20 -0300 Subject: [PATCH] Remove invalid comment/statement at role manager An invalid comment and unecessary try except statement are removed from role backend. Since list_role_assignments_for_role is implemented at assignment manager level and uses list_role_assignments, which is currently implemented by both sql and ldap backends, the added comment is invalid and the related bug is partially implemented. Related-Bug: #1221805 Change-Id: I55a4df5aae4f21dc64738b0ddf53580d890b9d1c --- keystone/assignment/core.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/keystone/assignment/core.py b/keystone/assignment/core.py index 4ec66268aa..a8fd539575 100644 --- a/keystone/assignment/core.py +++ b/keystone/assignment/core.py @@ -940,18 +940,7 @@ class RoleManager(manager.Manager): @notifications.deleted(_ROLE) def delete_role(self, role_id): - try: - self.assignment_api.delete_tokens_for_role_assignments(role_id) - except exception.NotImplemented: - # FIXME(morganfainberg): Not all backends (ldap) implement - # `list_role_assignments_for_role` which would have previously - # caused a NotImplmented error to be raised when called through - # the controller. Now error or proper action will always come from - # the `delete_role` method logic. Work needs to be done to make - # the behavior between drivers consistent (capable of revoking - # tokens for the same circumstances). This is related to the bug - # https://bugs.launchpad.net/keystone/+bug/1221805 - pass + self.assignment_api.delete_tokens_for_role_assignments(role_id) self.assignment_api.delete_role_assignments(role_id) self.driver.delete_role(role_id) self.get_role.invalidate(self, role_id)