Moved resources_to_operations to internal nbi.py valid_url_methods to avoid inconsistences
refactored session variable into token_info, engine_session, cherrypy.session to bring more clarity
commented unnecesary exception logs
inserted admin query string into roles permissions
Change-Id: Ib3d9d3210e4eb894a3f120c26f6d0ce032ebc797
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py
index ceb8e89..85fe9ff 100644
--- a/osm_nbi/admin_topics.py
+++ b/osm_nbi/admin_topics.py
@@ -402,8 +402,13 @@
raise EngineException("username '{}' is already used".format(username), HTTPStatus.CONFLICT)
if "projects" in indata.keys():
- raise EngineException("Format invalid: the keyword \"projects\" is not allowed for keystone authentication",
- HTTPStatus.BAD_REQUEST)
+ # convert to new format project_role_mappings
+ if not indata.get("project_role_mappings"):
+ indata["project_role_mappings"] = []
+ for project in indata["projects"]:
+ indata["project_role_mappings"].append({"project": project, "role": "project_user"})
+ # raise EngineException("Format invalid: the keyword 'projects' is not allowed for keystone authentication",
+ # HTTPStatus.BAD_REQUEST)
def check_conflict_on_edit(self, session, final_content, edit_content, _id):
"""