self.backend.update_user({"_id": user_admin_id,
"add_project_role_mappings": [{"project": pid, "role": role_id}]})
self.logger.info("Added role system admin to user='{}' project=admin".format(user_admin_id))
- except Exception:
- pass
+ except Exception as e:
+ self.logger.error("Error in Authorization DataBase initialization: {}: {}".format(type(e).__name__, e))
self.load_operation_to_allowed_roles()
user_id = user_obj.id
if user_info.get("password") or user_info.get("username") \
or user_info.get("add_project_role_mappings") or user_info.get("remove_project_role_mappings"):
+ ctime = user_obj._admin.get("created", 0) if hasattr(user_obj, "_admin") else 0
self.keystone.users.update(user_id, password=user_info.get("password"), name=user_info.get("username"),
- _admin={"created": user_obj._admin["created"], "modified": time.time()})
+ _admin={"created": ctime, "modified": time.time()})
for mapping in user_info.get("remove_project_role_mappings", []):
self.remove_role_from_user(user_id, mapping["project"], mapping["role"])
for mapping in user_info.get("add_project_role_mappings", []):