devstack: make sure it's possible to deploy panko only

Since Ie4c6329f7b3d1b4686555f7eea0525649d4b31f6 it's not possible to
deploy Ceilometer without backend, but with panko-api enabled, which
is a valid use case.

Split the if statement into two to make sure we do not execute the
else clause and die early.

Change-Id: Icfafc7bccd7b923707483d903bc5338921d14097
This commit is contained in:
Roman Podoliaka 2017-01-24 17:15:58 +02:00
parent 6eab130464
commit 226fdab31a

View File

@ -235,8 +235,13 @@ function _ceilometer_configure_storage_backend {
inidelete $CEILOMETER_CONF DEFAULT meter_dispatchers
inidelete $CEILOMETER_CONF DEFAULT event_dispatchers
if [ "$CEILOMETER_BACKEND" = 'none' ] && ! is_service_enabled panko-api; then
echo_summary "All Ceilometer backends seems disabled, set \$CEILOMETER_BACKEND to select one."
if [ "$CEILOMETER_BACKEND" = 'none' ] ; then
# It's ok for the backend to be 'none', if panko is enabled. We do not
# combine this condition with the outer if statement, so that the else
# clause below is not executed.
if ! is_service_enabled panko-api; then
echo_summary "All Ceilometer backends seems disabled, set \$CEILOMETER_BACKEND to select one."
fi
elif [ "$CEILOMETER_BACKEND" = 'mysql' ] || [ "$CEILOMETER_BACKEND" = 'postgresql' ] ; then
iniadd $CEILOMETER_CONF DEFAULT meter_dispatchers database
iniset $CEILOMETER_CONF database metering_connection $(database_connection_url ceilometer)