Merge "De-client-ify Role Delete"
This commit is contained in:
commit
6c1aafc9a0
@ -162,11 +162,6 @@ class EndpointDelete(task_manager.Task):
|
||||
return client.keystone_client.endpoints.delete(**self.args)
|
||||
|
||||
|
||||
class RoleDelete(task_manager.Task):
|
||||
def main(self, client):
|
||||
return client.keystone_client.roles.delete(**self.args)
|
||||
|
||||
|
||||
class RoleAddUser(task_manager.Task):
|
||||
def main(self, client):
|
||||
return client.keystone_client.roles.add_user_role(**self.args)
|
||||
|
@ -1653,9 +1653,11 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
|
||||
"Role %s not found for deleting", name_or_id)
|
||||
return False
|
||||
|
||||
with _utils.shade_exceptions("Unable to delete role {name}".format(
|
||||
name=name_or_id)):
|
||||
self.manager.submit_task(_tasks.RoleDelete(role=role['id']))
|
||||
v2 = self.cloud_config.get_api_version('identity').startswith('2')
|
||||
url = '{preffix}/{id}'.format(
|
||||
preffix='/OS-KSADM/roles' if v2 else '/roles', id=role['id'])
|
||||
error_msg = "Unable to delete role {name}".format(name=name_or_id)
|
||||
self._identity_client.delete(url, error_message=error_msg)
|
||||
|
||||
return True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user