Add role assignment

This commit is contained in:
Neill Cox 2023-09-18 11:06:31 +00:00
parent df8f079bc7
commit f149153c53

View file

@ -73,8 +73,17 @@ def create_user(args):
print(f"User created - id: {args.user_id}") print(f"User created - id: {args.user_id}")
def assign_member_role(args): def assign_member_role(args):
cmd = f"openstack role add --user {args.username} --project {args.project_id} member"
print(cmd) cmd = f"role add --user {args.username} --project {args.project_id} member"
result = openstack_cmd(cmd)
cmd = f"role assignment list --user {args.user_id} --role member -f json"
result = json.loads(openstack_cmd(cmd))
if result:
print("User has member role")
def create_public_network(args): def create_public_network(args):
print("creating public network - NYI") print("creating public network - NYI")