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
diff --git a/tools/upload_image.sh b/tools/upload_image.sh
index dd21c9f..d81a5c8 100755
--- a/tools/upload_image.sh
+++ b/tools/upload_image.sh
@@ -33,6 +33,7 @@
# Get a token to authenticate to glance
TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
+die_if_not_set $LINENO TOKEN "Keystone fail to get token"
# Glance connection info. Note the port must be specified.
GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$GLANCE_HOST:9292}