Skip to content

Commit

Permalink
Merge "HA script for provisioning keystone must add admin user to def…
Browse files Browse the repository at this point in the history
…ault domain for V3 case."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 18, 2017
2 parents c04141d + 3a2ab2f commit 826d010
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ function get_role() {
echo $id
}

# add domain level role
function user_role_add_domain() {
# openstack role add --user=$1 --domain $2 $3
curl -H"X-Auth-Token: $SERVICE_TOKEN" -X PUT http://localhost:5000/v3/domains/$2/users/$1/roles/$3
}

ADMIN_ROLE=$(get_role admin)
MEMBER_ROLE=$(get_role Member)
KEYSTONEADMIN_ROLE=$(get_role KeystoneAdmin)
Expand All @@ -161,6 +167,9 @@ function user_role_lookup() {
# Add Roles to Users in Tenants
if [ -z $(user_role_lookup $ADMIN_USER $ADMIN_TENANT admin) ]; then
keystone $INSECURE_FLAG user-role-add --user-id $ADMIN_USER --role-id $ADMIN_ROLE --tenant-id $ADMIN_TENANT
if [ "$KEYSTONE_VERSION" == "v3" ]; then
user_role_add_domain $ADMIN_USER "default" $ADMIN_ROLE
fi
fi

if [ -z $(user_role_lookup $DEMO_USER $DEMO_TENANT Member) ]; then
Expand Down

0 comments on commit 826d010

Please sign in to comment.