Fix is_keystone_enabled()
is_keystone_enabled() was calling is_service_enabled(), which is what called
is_keystone_enabled() in the first place. Make it work as designed and
also change calls to use the full service name. Note that this is all
still comptible with the prior usage of 'is_service_enabled key'.
Change-Id: I9c28377ecf074b7996461d2a4ca12d88dfc4d47e
diff --git a/functions-common b/functions-common
index 6beb670..ecaa4d9 100644
--- a/functions-common
+++ b/functions-common
@@ -1817,7 +1817,6 @@
[[ ${service} == "trove" && ${ENABLED_SERVICES} =~ "tr-" ]] && enabled=0
[[ ${service} == "swift" && ${ENABLED_SERVICES} =~ "s-" ]] && enabled=0
[[ ${service} == s-* && ${ENABLED_SERVICES} =~ "swift" ]] && enabled=0
- [[ ${service} == key-* && ${ENABLED_SERVICES} =~ "key" ]] && enabled=0
done
$xtrace
return $enabled
diff --git a/lib/keystone b/lib/keystone
index 2da2d1b..102d188 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -111,8 +111,17 @@
KEYSTONE_AUTH_URI_V3=$KEYSTONE_AUTH_URI/v3
KEYSTONE_SERVICE_URI_V3=$KEYSTONE_SERVICE_URI/v3
+
# Functions
# ---------
+
+# Test if Keystone is enabled
+# is_keystone_enabled
+function is_keystone_enabled {
+ [[ ,${ENABLED_SERVICES}, =~ ,"key", ]] && return 0
+ return 1
+}
+
# cleanup_keystone() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_keystone {
@@ -576,9 +585,6 @@
stop_process key
}
-function is_keystone_enabled {
- return is_service_enabled key
-}
# Restore xtrace
$XTRACE
diff --git a/lib/swift b/lib/swift
index e4d8b5f..2bb6422 100644
--- a/lib/swift
+++ b/lib/swift
@@ -393,7 +393,7 @@
swift_pipeline+=" swift3 s3token "
fi
- if is_service_enabled key;then
+ if is_service_enabled keystone; then
swift_pipeline+=" authtoken keystoneauth"
fi
swift_pipeline+=" tempauth "
@@ -498,7 +498,7 @@
iniset ${testfile} func_test password4 testing4
iniset ${testfile} func_test domain4 swift_test
- if is_service_enabled key;then
+ if is_service_enabled keystone; then
iniuncomment ${testfile} func_test auth_version
local auth_vers=$(iniget ${testfile} func_test auth_version)
iniset ${testfile} func_test auth_host ${KEYSTONE_SERVICE_HOST}
diff --git a/stack.sh b/stack.sh
index 3f97919..da20276 100755
--- a/stack.sh
+++ b/stack.sh
@@ -601,7 +601,7 @@
# Keystone
-if is_service_enabled key; then
+if is_service_enabled keystone; then
# The ``SERVICE_TOKEN`` is used to bootstrap the Keystone database. It is
# just a string and is not a 'real' Keystone token.
read_password SERVICE_TOKEN "ENTER A SERVICE_TOKEN TO USE FOR THE SERVICE ADMIN TOKEN."
@@ -725,7 +725,7 @@
fi
-if is_service_enabled key; then
+if is_service_enabled keystone; then
if [ "$KEYSTONE_AUTH_HOST" == "$SERVICE_HOST" ]; then
install_keystone
configure_keystone
@@ -918,7 +918,7 @@
# Keystone
# --------
-if is_service_enabled key; then
+if is_service_enabled keystone; then
echo_summary "Starting Keystone"
if [ "$KEYSTONE_AUTH_HOST" == "$SERVICE_HOST" ]; then
@@ -1143,7 +1143,7 @@
fi
# Create an access key and secret key for nova ec2 register image
-if is_service_enabled key && is_service_enabled swift3 && is_service_enabled nova; then
+if is_service_enabled keystone && is_service_enabled swift3 && is_service_enabled nova; then
eval $(openstack ec2 credentials create --user nova --project $SERVICE_TENANT_NAME -f shell -c access -c secret)
iniset $NOVA_CONF DEFAULT s3_access_key "$access"
iniset $NOVA_CONF DEFAULT s3_secret_key "$secret"
@@ -1226,7 +1226,7 @@
# This step also creates certificates for tenants and users,
# which is helpful in image bundle steps.
-if is_service_enabled nova && is_service_enabled key; then
+if is_service_enabled nova && is_service_enabled keystone; then
USERRC_PARAMS="-PA --target-dir $TOP_DIR/accrc"
if [ -f $SSL_BUNDLE_FILE ]; then
@@ -1314,7 +1314,7 @@
fi
# If Keystone is present you can point ``nova`` cli to this server
-if is_service_enabled key; then
+if is_service_enabled keystone; then
echo "Keystone is serving at $KEYSTONE_SERVICE_URI/v2.0/"
echo "Examples on using novaclient command line is in exercise.sh"
echo "The default users are: admin and demo"
diff --git a/unstack.sh b/unstack.sh
index 4364e58..f31b84c 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -112,7 +112,7 @@
stop_glance
fi
-if is_service_enabled key; then
+if is_service_enabled keystone; then
stop_keystone
fi