Merge "Fix return value of get_or_add_user_project_role"
This commit is contained in:
commit
dae0e463b8
@ -830,14 +830,20 @@ function get_or_add_user_project_role {
|
||||
--column "Name" \
|
||||
| grep " $1 " | get_field 1)
|
||||
if [[ -z "$user_role_id" ]]; then
|
||||
# Adds role to user
|
||||
user_role_id=$(openstack role add \
|
||||
$1 \
|
||||
# Adds role to user and get it
|
||||
openstack role add $1 \
|
||||
--user $2 \
|
||||
--project $3 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3
|
||||
user_role_id=$(openstack role list \
|
||||
--user $2 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3 \
|
||||
| grep " id " | get_field 2)
|
||||
--column "ID" \
|
||||
--project $3 \
|
||||
--column "Name" \
|
||||
| grep " $1 " | get_field 1)
|
||||
fi
|
||||
echo $user_role_id
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user