Merge "Fixes bug lp:897819"
This commit is contained in:
commit
d410637b90
|
@ -87,6 +87,7 @@ class UserRoleAssociation(Base, KeystoneBase):
|
|||
__table_args__ = (UniqueConstraint("user_id", "role_id", "tenant_id"), {})
|
||||
|
||||
user = relationship('User')
|
||||
role = relationship('Role')
|
||||
|
||||
|
||||
class Endpoints(Base, KeystoneBase):
|
||||
|
|
|
@ -168,7 +168,8 @@ def process(*args):
|
|||
if tenant:
|
||||
# print with users
|
||||
print 'Role assignments for tenant %s' % tenant
|
||||
print_table(('User', 'Role'), api.list_roles(tenant=tenant))
|
||||
print_table(('User', 'Role'),
|
||||
api.list_roles(tenant=tenant))
|
||||
else:
|
||||
# print without tenants
|
||||
print_table(('id', 'name', 'service_id', 'description'),
|
||||
|
|
|
@ -64,7 +64,7 @@ def list_role_assignments(tenant):
|
|||
objects = db_api.TENANT.get_role_assignments(tenant)
|
||||
if objects is None:
|
||||
raise IndexError("Assignments not found")
|
||||
return [[o.user_id, o.role_id] for o in objects]
|
||||
return [[o.user.name, o.role.name] for o in objects]
|
||||
|
||||
|
||||
def list_roles(tenant=None):
|
||||
|
|
Loading…
Reference in New Issue