Browse code

detect failure of 'keystone token-get'

When 'keystone token-get' fails, the caller can't detect the failure.
This cause troulbe shooting a bit complicated.

Change-Id: I3c58c5fd0e92a87e87546ea797904e08646a1097
Closes-Bug: #1238412

DennyZhang authored on 2013/10/11 14:08:29
Showing 3 changed files
... ...
@@ -102,6 +102,7 @@ KEYSTONE="keystone"
102 102
 # and save it.
103 103
 
104 104
 TOKEN=`keystone token-get | grep ' id ' | awk '{print $4}'`
105
+die_if_not_set $LINENO TOKEN "Keystone fail to get token"
105 106
 
106 107
 # Various functions
107 108
 # -----------------
... ...
@@ -1203,6 +1203,7 @@ fi
1203 1203
 
1204 1204
 if is_service_enabled g-reg; then
1205 1205
     TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
1206
+    die_if_not_set $LINENO TOKEN "Keystone fail to get token"
1206 1207
 
1207 1208
     if is_baremetal; then
1208 1209
        echo_summary "Creating and uploading baremetal images"
... ...
@@ -33,6 +33,7 @@ fi
33 33
 
34 34
 # Get a token to authenticate to glance
35 35
 TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
36
+die_if_not_set $LINENO TOKEN "Keystone fail to get token"
36 37
 
37 38
 # Glance connection info.  Note the port must be specified.
38 39
 GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$GLANCE_HOST:9292}