X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fauthconn_keystone.py;h=7f592700c581d2a8ae6726f689c3dfaa06192d25;hp=b0cab0c7af6b1139583412b6fbcd45d792c31473;hb=37de09105822b2b4db8b0ebac1ec5994af5d0fd9;hpb=fa54cd99ee561e02ef95128cd3d25074aa1dbe54 diff --git a/osm_nbi/authconn_keystone.py b/osm_nbi/authconn_keystone.py index b0cab0c..7f59270 100644 --- a/osm_nbi/authconn_keystone.py +++ b/osm_nbi/authconn_keystone.py @@ -258,10 +258,11 @@ class AuthconnKeystone(Authconn): users = self.keystone.users.list() users = [{ "username": user.name, - "_id": user.id + "_id": user.id, + "id": user.id } for user in users if user.name != self.admin_username] - allowed_fields = ["_id", "username"] + allowed_fields = ["_id", "id", "username"] for key in filter_q.keys(): if key not in allowed_fields: continue @@ -273,14 +274,16 @@ class AuthconnKeystone(Authconn): projects = self.keystone.projects.list(user=user["_id"]) projects = [{ "name": project.name, - "_id": project.id + "_id": project.id, + "id": project.id } for project in projects] for project in projects: roles = self.keystone.roles.list(user=user["_id"], project=project["_id"]) roles = [{ "name": role.name, - "_id": role.id + "_id": role.id, + "id": role.id } for role in roles] project["roles"] = roles @@ -295,8 +298,7 @@ class AuthconnKeystone(Authconn): """ Get role list. - :return: returns the list of roles for the user in that project. If - the token is unscoped it returns None. + :return: returns the list of roles. """ try: roles_list = self.keystone.roles.list()