diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-08-18 23:30:54 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-08-18 23:30:54 +0000 |
| commit | 7489fa36aac04dd4185d5e2af16fcacade1f7da9 (patch) | |
| tree | cc6a6cd548aaeb8a462b755e3a9e8dad38218910 /openstackclient/identity/v3/role_assignment.py | |
| parent | 8cef12ce0847cdc7e95922d0c759d583feb46735 (diff) | |
| parent | 5eb7e626b18b033f97f3cf10f2791529f9d75789 (diff) | |
| download | python-openstackclient-7489fa36aac04dd4185d5e2af16fcacade1f7da9.tar.gz | |
Merge "Add support for domain specific roles"
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']) |
