summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3/role_assignment.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/identity/v3/role_assignment.py')
-rw-r--r--openstackclient/identity/v3/role_assignment.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/openstackclient/identity/v3/role_assignment.py b/openstackclient/identity/v3/role_assignment.py
index 6177d1a5..d25cc6ce 100644
--- a/openstackclient/identity/v3/role_assignment.py
+++ b/openstackclient/identity/v3/role_assignment.py
@@ -36,6 +36,7 @@ class ListRoleAssignment(command.Lister):
metavar='<role>',
help=_('Role to filter (name or ID)'),
)
+ common.add_role_domain_option_to_parser(parser)
parser.add_argument(
'--names',
action="store_true",
@@ -91,10 +92,15 @@ class ListRoleAssignment(command.Lister):
auth_ref = self.app.client_manager.auth_ref
role = None
+ role_domain_id = None
+ if parsed_args.role_domain:
+ role_domain_id = common.find_domain(identity_client,
+ parsed_args.role_domain).id
if parsed_args.role:
role = utils.find_resource(
identity_client.roles,
parsed_args.role,
+ domain_id=role_domain_id
)
user = None
@@ -205,6 +211,12 @@ class ListRoleAssignment(command.Lister):
if hasattr(assignment, 'role'):
if include_names:
+ # TODO(henry-nash): If this is a domain specific role it
+ # would be good show this as role@domain, although this
+ # domain info is not yet included in the response from the
+ # server. Although we could get it by re-reading the role
+ # from the ID, let's wait until the server does the right
+ # thing.
setattr(assignment, 'role', assignment.role['name'])
else:
setattr(assignment, 'role', assignment.role['id'])