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
This commit is contained in:
Samuel de Medeiros Queiroz 2015-02-21 01:22:20 -03:00
parent e03c699e86
commit ed9324ee32
1 changed files with 1 additions and 12 deletions

View File

@ -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)