Browse code

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

Clark Boylan authored on 2017/05/26 06:57:19
Showing 1 changed files
... ...
@@ -512,17 +512,24 @@ function start_cinder {
512 512
         fi
513 513
     fi
514 514
 
515
-    if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then
516
-        enable_apache_site osapi-volume
517
-        restart_apache_server
518
-        tail_log c-api /var/log/$APACHE_NAME/c-api.log
519
-    else
520
-        run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
521
-    fi
515
+    if is_service_enabled c-api ; then
516
+        if [ "$CINDER_USE_MOD_WSGI" == "True" ]; then
517
+            enable_apache_site osapi-volume
518
+            restart_apache_server
519
+            tail_log c-api /var/log/$APACHE_NAME/c-api.log
520
+        else
521
+            run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
522
+        fi
522 523
 
523
-    echo "Waiting for Cinder API to start..."
524
-    if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$CINDER_SERVICE_HOST:$service_port; then
525
-        die $LINENO "c-api did not start"
524
+        echo "Waiting for Cinder API to start..."
525
+        if ! wait_for_service $SERVICE_TIMEOUT $service_protocol://$CINDER_SERVICE_HOST:$service_port; then
526
+            die $LINENO "c-api did not start"
527
+        fi
528
+
529
+        # Start proxies if enabled
530
+        if is_service_enabled tls-proxy; then
531
+            start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT
532
+        fi
526 533
     fi
527 534
 
528 535
     run_process c-sch "$CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF"
... ...
@@ -532,11 +539,6 @@ function start_cinder {
532 532
     # NOTE(jdg): For cinder, startup order matters.  To ensure that repor_capabilities is received
533 533
     # by the scheduler start the cinder-volume service last (or restart it) after the scheduler
534 534
     # has started.  This is a quick fix for lp bug/1189595
535
-
536
-    # Start proxies if enabled
537
-    if is_service_enabled c-api && is_service_enabled tls-proxy; then
538
-        start_tls_proxy cinder '*' $CINDER_SERVICE_PORT $CINDER_SERVICE_HOST $CINDER_SERVICE_PORT_INT
539
-    fi
540 535
 }
541 536
 
542 537
 # stop_cinder() - Stop running processes