Evaluate --inherited in role list

the --inherited option was not being passed into keystoneclient

Closes-Bug: #1502822

Change-Id: I48170dc67b23cc9b0665b1e0f38118eea952f131
This commit is contained in:
Rudolf Vriend 2015-10-06 17:14:25 +02:00 committed by Steve Martinelli
parent e926998700
commit 7075c90053
2 changed files with 10 additions and 0 deletions

View File

@ -260,6 +260,7 @@ class ListRole(lister.Lister):
data = identity_client.roles.list( data = identity_client.roles.list(
user=user, user=user,
domain=domain, domain=domain,
os_inherit_extension_inherited=parsed_args.inherited
) )
for user_role in data: for user_role in data:
user_role.user = user.name user_role.user = user.name
@ -269,6 +270,7 @@ class ListRole(lister.Lister):
data = identity_client.roles.list( data = identity_client.roles.list(
user=user, user=user,
project=project, project=project,
os_inherit_extension_inherited=parsed_args.inherited
) )
for user_role in data: for user_role in data:
user_role.user = user.name user_role.user = user.name
@ -278,12 +280,14 @@ class ListRole(lister.Lister):
data = identity_client.roles.list( data = identity_client.roles.list(
user=user, user=user,
domain='default', domain='default',
os_inherit_extension_inherited=parsed_args.inherited
) )
elif parsed_args.group and parsed_args.domain: elif parsed_args.group and parsed_args.domain:
columns = ('ID', 'Name', 'Domain', 'Group') columns = ('ID', 'Name', 'Domain', 'Group')
data = identity_client.roles.list( data = identity_client.roles.list(
group=group, group=group,
domain=domain, domain=domain,
os_inherit_extension_inherited=parsed_args.inherited
) )
for group_role in data: for group_role in data:
group_role.group = group.name group_role.group = group.name
@ -293,6 +297,7 @@ class ListRole(lister.Lister):
data = identity_client.roles.list( data = identity_client.roles.list(
group=group, group=group,
project=project, project=project,
os_inherit_extension_inherited=parsed_args.inherited
) )
for group_role in data: for group_role in data:
group_role.group = group.name group_role.group = group.name

View File

@ -383,6 +383,7 @@ class TestRoleList(TestRole):
kwargs = { kwargs = {
'domain': 'default', 'domain': 'default',
'user': self.users_mock.get(), 'user': self.users_mock.get(),
'os_inherit_extension_inherited': False
} }
# RoleManager.list(user=, group=, domain=, project=, **kwargs) # RoleManager.list(user=, group=, domain=, project=, **kwargs)
self.roles_mock.list.assert_called_with( self.roles_mock.list.assert_called_with(
@ -415,6 +416,7 @@ class TestRoleList(TestRole):
kwargs = { kwargs = {
'domain': self.domains_mock.get(), 'domain': self.domains_mock.get(),
'user': self.users_mock.get(), 'user': self.users_mock.get(),
'os_inherit_extension_inherited': False
} }
# RoleManager.list(user=, group=, domain=, project=, **kwargs) # RoleManager.list(user=, group=, domain=, project=, **kwargs)
self.roles_mock.list.assert_called_with( self.roles_mock.list.assert_called_with(
@ -449,6 +451,7 @@ class TestRoleList(TestRole):
kwargs = { kwargs = {
'domain': self.domains_mock.get(), 'domain': self.domains_mock.get(),
'group': self.groups_mock.get(), 'group': self.groups_mock.get(),
'os_inherit_extension_inherited': False
} }
# RoleManager.list(user=, group=, domain=, project=, **kwargs) # RoleManager.list(user=, group=, domain=, project=, **kwargs)
self.roles_mock.list.assert_called_with( self.roles_mock.list.assert_called_with(
@ -483,6 +486,7 @@ class TestRoleList(TestRole):
kwargs = { kwargs = {
'project': self.projects_mock.get(), 'project': self.projects_mock.get(),
'user': self.users_mock.get(), 'user': self.users_mock.get(),
'os_inherit_extension_inherited': False
} }
# RoleManager.list(user=, group=, domain=, project=, **kwargs) # RoleManager.list(user=, group=, domain=, project=, **kwargs)
self.roles_mock.list.assert_called_with( self.roles_mock.list.assert_called_with(
@ -517,6 +521,7 @@ class TestRoleList(TestRole):
kwargs = { kwargs = {
'project': self.projects_mock.get(), 'project': self.projects_mock.get(),
'group': self.groups_mock.get(), 'group': self.groups_mock.get(),
'os_inherit_extension_inherited': False
} }
# RoleManager.list(user=, group=, domain=, project=, **kwargs) # RoleManager.list(user=, group=, domain=, project=, **kwargs)
self.roles_mock.list.assert_called_with( self.roles_mock.list.assert_called_with(