Skip to content

Commit ebad9cc

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix keystone auth failures"
2 parents 3989810 + 5cc2129 commit ebad9cc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

stack.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,11 +2026,17 @@ if is_service_enabled key; then
20262026
DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES \
20272027
bash $FILES/keystone_data.sh
20282028
2029+
# Set up auth creds now that keystone is bootstrapped
2030+
export OS_AUTH_URL=$SERVICE_ENDPOINT
2031+
export OS_TENANT_NAME=admin
2032+
export OS_USERNAME=admin
2033+
export OS_PASSWORD=$ADMIN_PASSWORD
2034+
20292035
# create an access key and secret key for nova ec2 register image
20302036
if is_service_enabled swift && is_service_enabled nova; then
20312037
NOVA_USER_ID=$(keystone user-list | grep ' nova ' | get_field 1)
20322038
NOVA_TENANT_ID=$(keystone tenant-list | grep " $SERVICE_TENANT_NAME " | get_field 1)
2033-
CREDS=$(keystone ec2-credentials-create --user $NOVA_USER_ID --tenant_id $NOVA_TENANT_ID)
2039+
CREDS=$(keystone ec2-credentials-create --user_id $NOVA_USER_ID --tenant_id $NOVA_TENANT_ID)
20342040
ACCESS_KEY=$(echo "$CREDS" | awk '/ access / { print $4 }')
20352041
SECRET_KEY=$(echo "$CREDS" | awk '/ secret / { print $4 }')
20362042
add_nova_opt "s3_access_key=$ACCESS_KEY"
@@ -2108,9 +2114,7 @@ if is_service_enabled g-reg; then
21082114
# Create a directory for the downloaded image tarballs.
21092115
mkdir -p $FILES/images
21102116
2111-
ADMIN_USER=admin
2112-
ADMIN_TENANT=admin
2113-
TOKEN=$(keystone --os_tenant_name $ADMIN_TENANT --os_username $ADMIN_USER --os_password $ADMIN_PASSWORD --os_auth_url http://$HOST_IP:5000/v2.0 token-get | grep ' id ' | get_field 2)
2117+
TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
21142118
21152119
# Option to upload legacy ami-tty, which works with xenserver
21162120
if [[ -n "$UPLOAD_LEGACY_TTY" ]]; then

0 commit comments

Comments
 (0)