Browse code

Merge "Fix keystone auth failures"

Jenkins authored on 2012/06/29 21:12:11
Showing 1 changed files
... ...
@@ -2026,11 +2026,17 @@ if is_service_enabled key; then
2026 2026
     DEVSTACK_DIR=$TOP_DIR ENABLED_SERVICES=$ENABLED_SERVICES \
2027 2027
         bash $FILES/keystone_data.sh
2028 2028
 
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
+
2029 2035
     # create an access key and secret key for nova ec2 register image
2030 2036
     if is_service_enabled swift && is_service_enabled nova; then
2031 2037
         NOVA_USER_ID=$(keystone user-list | grep ' nova ' | get_field 1)
2032 2038
         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)
2034 2040
         ACCESS_KEY=$(echo "$CREDS" | awk '/ access / { print $4 }')
2035 2041
         SECRET_KEY=$(echo "$CREDS" | awk '/ secret / { print $4 }')
2036 2042
         add_nova_opt "s3_access_key=$ACCESS_KEY"
... ...
@@ -2108,9 +2114,7 @@ if is_service_enabled g-reg; then
2108 2108
     # Create a directory for the downloaded image tarballs.
2109 2109
     mkdir -p $FILES/images
2110 2110
 
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)
2111
+    TOKEN=$(keystone  token-get | grep ' id ' | get_field 2)
2114 2112
 
2115 2113
     # Option to upload legacy ami-tty, which works with xenserver
2116 2114
     if [[ -n "$UPLOAD_LEGACY_TTY" ]]; then