summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c5a1889)
Change-Id: I66406b2afcdbbb6a0717197a728d65fde45e7b27
Signed-off-by: Eduardo Sousa <eduardo.sousa@canonical.com>
self.format_on_new(content, session["project_id"], make_public=session["public"])
_id = self.auth.create_user(content["username"], content["password"])["_id"]
self.format_on_new(content, session["project_id"], make_public=session["public"])
_id = self.auth.create_user(content["username"], content["password"])["_id"]
- for mapping in content["project_role_mappings"]:
- self.auth.assign_role_to_user(_id, mapping["project"], mapping["role"])
+ if "project_role_mappings" in content.keys():
+ for mapping in content["project_role_mappings"]:
+ self.auth.assign_role_to_user(_id, mapping["project"], mapping["role"])
rollback.append({"topic": self.topic, "_id": _id})
del content["password"]
rollback.append({"topic": self.topic, "_id": _id})
del content["password"]
if path.isfile(config_file):
resources_to_operations_file = config_file
break
if path.isfile(config_file):
resources_to_operations_file = config_file
break
- if not resources_to_operations_file:
+ if not resources_to_operations_file:
raise EngineException("Invalid permission configuration: resources_to_operations file missing")
raise EngineException("Invalid permission configuration: resources_to_operations file missing")
with open(resources_to_operations_file, 'r') as f:
resources_to_operations = yaml.load(f)
with open(resources_to_operations_file, 'r') as f:
resources_to_operations = yaml.load(f)
self.operations = []
for _, value in resources_to_operations["resources_to_operations"].items():
self.operations = []
for _, value in resources_to_operations["resources_to_operations"].items():