Merge "Fixes bug lp:897819"

This commit is contained in:
Jenkins 2011-11-30 04:05:30 +00:00 committed by Gerrit Code Review
commit d410637b90
3 changed files with 4 additions and 2 deletions

View File

@ -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):

View File

@ -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'),

View File

@ -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):