From cdda91986bf5045bda0476f85425f35a0053bc57 Mon Sep 17 00:00:00 2001 From: Guang Yee Date: Thu, 20 Nov 2014 16:49:16 -0800 Subject: [PATCH] make sample_data.sh account for the default options in keystone.conf Closes-Bug: 1394816 Change-Id: Ifb19d09a1ed8e82aebcaea82783480176daa3536 --- tools/sample_data.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/sample_data.sh b/tools/sample_data.sh index 4576dee9e1..55ab9d2148 100755 --- a/tools/sample_data.sh +++ b/tools/sample_data.sh @@ -68,7 +68,15 @@ fi # Extract some info from Keystone's configuration file if [[ -r "$KEYSTONE_CONF" ]]; then CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2) + if [[ -z "${CONFIG_SERVICE_TOKEN}" ]]; then + # default config options are commented out, so lets try those + CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^\#admin_token= | cut -d'=' -f2) + fi CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2) + if [[ -z "${CONFIG_ADMIN_PORT}" ]]; then + # default config options are commented out, so lets try those + CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^\#admin_port= | cut -d'=' -f2) + fi fi export OS_SERVICE_TOKEN=${OS_SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN}