diff --git a/opl/rbac_populate.py b/opl/rbac_populate.py index f01cc48..b38e435 100644 --- a/opl/rbac_populate.py +++ b/opl/rbac_populate.py @@ -178,10 +178,11 @@ def add_roles_to_group(url_base, x_rh_identity, role_list, group_uuid): def create_principal(cursor, account): user_uuid = str(uuid.uuid4()) user_name = "user-" + user_uuid + user_type = "user" logging.info(f"Creating principal username = {user_name}") cursor.execute( - "INSERT INTO public.management_principal (uuid, username, tenant_id) VALUES (%s, %s, (SELECT id FROM public.api_tenant WHERE tenant_name = 'acct' || %s)) RETURNING id", - (user_uuid, user_name, account), + "INSERT INTO public.management_principal (uuid, username, tenant_id) VALUES (%s, %s, (SELECT id FROM public.api_tenant WHERE tenant_name = 'acct' || %s), %s) RETURNING id", + (user_uuid, user_name, account, user_type), ) user_id = cursor.fetchone()[0] return user_name, user_id