Cleanup duplicate get_or_add_user_domain_role
It turns out that we ended up with duplicate versions of this function merging on top of each other within 3 days, and gerrit didn't catch it. Boo gerrit. Boo bash. Change-Id: Ic6aa2f9bafdec906de2bc51d5929beeec48a6a40
This commit is contained in:
parent
e2fb00ebb7
commit
1b245cef7f
@ -905,34 +905,6 @@ function get_or_add_user_domain_role {
|
||||
echo $user_role_id
|
||||
}
|
||||
|
||||
# Gets or adds user role to domain
|
||||
# Usage: get_or_add_user_domain_role <role> <user> <domain>
|
||||
function get_or_add_user_domain_role {
|
||||
local user_role_id
|
||||
# Gets user role id
|
||||
user_role_id=$(openstack role assignment list \
|
||||
--user $2 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3 \
|
||||
--domain $3 \
|
||||
| grep " $1 " | get_field 1)
|
||||
if [[ -z "$user_role_id" ]]; then
|
||||
# Adds role to user and get it
|
||||
openstack role add $1 \
|
||||
--user $2 \
|
||||
--domain $3 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3
|
||||
user_role_id=$(openstack role assignment list \
|
||||
--user $2 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3 \
|
||||
--domain $3 \
|
||||
| grep " $1 " | get_field 1)
|
||||
fi
|
||||
echo $user_role_id
|
||||
}
|
||||
|
||||
# Gets or adds group role to project
|
||||
# Usage: get_or_add_group_project_role <role> <group> <project>
|
||||
function get_or_add_group_project_role {
|
||||
|
Loading…
x
Reference in New Issue
Block a user