Browse code

Update stack.sh to use openstackclient commands

There were a few instances of keystoneclient still being used,
these were replaced with their openstackclient equivalent.

Change-Id: I47fb7cf949b9ab054b97ae387ecbc6d7070fa9c3

Steve Martinelli authored on 2014/03/14 13:38:11
Showing 1 changed files
... ...
@@ -1134,15 +1134,9 @@ fi
1134 1134
 
1135 1135
 # Create an access key and secret key for nova ec2 register image
1136 1136
 if is_service_enabled key && is_service_enabled swift3 && is_service_enabled nova; then
1137
-    NOVA_USER_ID=$(keystone user-list | grep ' nova ' | get_field 1)
1138
-    die_if_not_set $LINENO NOVA_USER_ID "Failure retrieving NOVA_USER_ID for nova"
1139
-    NOVA_TENANT_ID=$(keystone tenant-list | grep " $SERVICE_TENANT_NAME " | get_field 1)
1140
-    die_if_not_set $LINENO NOVA_TENANT_ID "Failure retrieving NOVA_TENANT_ID for $SERVICE_TENANT_NAME"
1141
-    CREDS=$(keystone ec2-credentials-create --user-id $NOVA_USER_ID --tenant-id $NOVA_TENANT_ID)
1142
-    ACCESS_KEY=$(echo "$CREDS" | awk '/ access / { print $4 }')
1143
-    SECRET_KEY=$(echo "$CREDS" | awk '/ secret / { print $4 }')
1144
-    iniset $NOVA_CONF DEFAULT s3_access_key "$ACCESS_KEY"
1145
-    iniset $NOVA_CONF DEFAULT s3_secret_key "$SECRET_KEY"
1137
+    eval $(openstack ec2 credentials create --user nova --project $SERVICE_TENANT_NAME -f shell -c access -c secret)
1138
+    iniset $NOVA_CONF DEFAULT s3_access_key "$access"
1139
+    iniset $NOVA_CONF DEFAULT s3_secret_key "$secret"
1146 1140
     iniset $NOVA_CONF DEFAULT s3_affix_tenant "True"
1147 1141
 fi
1148 1142