diff options
| author | Henry Nash <henryn@linux.vnet.ibm.com> | 2016-02-23 11:42:40 +0000 |
|---|---|---|
| committer | Steve Martinelli <s.martinelli@gmail.com> | 2016-08-10 20:32:55 +0000 |
| commit | 5eb7e626b18b033f97f3cf10f2791529f9d75789 (patch) | |
| tree | 1b371a8835abe4dfbf82dbc8003a08621138bb5b /openstackclient/identity/v3/role_assignment.py | |
| parent | 0b91368164acc596bf97fe4073083e26892f5b1a (diff) | |
| download | python-openstackclient-5eb7e626b18b033f97f3cf10f2791529f9d75789.tar.gz | |
Add support for domain specific roles
A role entity can now be specified as domain specific.
Closes-bug: #1606105
Change-Id: I564cf3da1d61f5bfcf85be591480d2f5c8d694a0
Diffstat (limited to 'openstackclient/identity/v3/role_assignment.py')
| -rw-r--r-- | openstackclient/identity/v3/role_assignment.py | 12 |
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']) |
