From 2dfca047d97d4867048dbc9eec34b6f7ff54655e Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 25 May 2017 14:57:19 -0700 Subject: [PATCH] Don't run and check c-api if it is disabled Previously we didn't block out the c-api startup code because the devstack functions to start services check that for us. However, since the cinder devstack code checks the service is up and runs the tls proxy if tls is enabled we need to block it all off to avoid doing those things if c-api is disabled. Change-Id: I1c4f22f785af96caaf4baa21ff28714b9afd3458 --- lib/cinder | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/cinder b/lib/cinder index e3a687b4f2..f36c179cf2 100644 --- a/lib/cinder +++ b/lib/cinder @@ -512,17 +512,24 @@ function start_cinder { fi fi - if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then - enable_apache_site osapi-volume - restart_apache_server - tail_log c-api /var/log/$APACHE_NAME/c-api.log - else - run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF" - fi + if is_service_enabled c-api ; then + if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then + enable_apache_site osapi-volume + restart_apache_server + tail_log c-api /var/log/$APACHE_NAME/c-api.log + else + run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF" + fi - echo "Waiting for Cinder API to start..." - if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$CINDER_SERVICE_HOST:$service_port; then - die $LINENO "c-api did not start" + echo "Waiting for Cinder API to start..." + if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$CINDER_SERVICE_HOST:$service_port; then + die $LINENO "c-api did not start" + fi + + # Start proxies if enabled + if is_service_enabled tls-proxy; then + start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT + fi fi run_process c-sch "$CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF" @@ -532,11 +539,6 @@ function start_cinder { # NOTE(jdg): For cinder, startup order matters. To ensure that repor_capabilities is received # by the scheduler start the cinder-volume service last (or restart it) after the scheduler # has started. This is a quick fix for lp bug/1189595 - - # Start proxies if enabled - if is_service_enabled c-api && is_service_enabled tls-proxy; then - start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT - fi } # stop_cinder() - Stop running processes