Assign users to group

Change-Id: I9ee1ecaa46afce862881aee2b5247dd48354dc3e
This commit is contained in:
openstack
2019-05-01 17:16:55 -05:00
committed by Hari
parent 5fd1896a96
commit 28c137bbc8
20 changed files with 650 additions and 89 deletions

View File

@@ -38,10 +38,28 @@ def yamlbuilder(alldata, region):
}
}
if "groups_roles" in jsondata and len(jsondata["groups_roles"]) > 0:
if "groups_users" in jsondata and len(jsondata["groups_users"]) > 0:
template_name = '{}_user_assignments'.format(group_name)
users = []
template_name = "{}-Role-Assignment".format(group_name)
for user in jsondata['groups_users']:
users.append({
"name": user["user_name"],
"user_domain": user["domain_name"]
})
resources["resources"][template_name] = {
'type': 'OS::Keystone::GroupUserAssignment\n',
'properties': {
'group': "{get_resource: %s}" % group_name,
'group_domain': "%s" % jsondata['domain_name'],
}
}
if "groups_roles" in jsondata and len(jsondata["groups_roles"]) > 0:
template_name = "{}_role_assignments".format(group_name)
roles = []
for customer_role in jsondata["groups_customer_roles"]:
roles.append({
"role": customer_role["role_name"],