Browse code

scope warnings to only display if the services are enabled

On my devstack environments I'm now always getting the Q_AGENT
warnings even though I don't have neutron enabled. This is mostly
confusing.

For these juno warnings lets just make sure that the whole thing
only prints out in the case where we've actually got that service
enabled.

Change-Id: I7d1bb2e65594c8bee2f572ca58a1b666e5d6caed

Sean Dague authored on 2014/08/08 08:28:41
Showing 1 changed files
... ...
@@ -1392,51 +1392,55 @@ if [[ -n "$DEPRECATED_TEXT" ]]; then
1392 1392
     echo_summary "WARNING: $DEPRECATED_TEXT"
1393 1393
 fi
1394 1394
 
1395
-# TODO(dtroyer): Remove Q_AGENT_EXTRA_AGENT_OPTS after stable/juno branch is cut
1396
-if [[ -n "$Q_AGENT_EXTRA_AGENT_OPTS" ]]; then
1397
-    echo ""
1398
-    echo_summary "WARNING: Q_AGENT_EXTRA_AGENT_OPTS is used"
1399
-    echo "You are using Q_AGENT_EXTRA_AGENT_OPTS to pass configuration into $NEUTRON_CONF."
1400
-    echo "Please convert that configuration in localrc to a $NEUTRON_CONF section in local.conf:"
1401
-    echo "Q_AGENT_EXTRA_AGENT_OPTS will be removed early in the 'K' development cycle"
1402
-    echo "
1395
+if is_service_enabled neutron; then
1396
+    # TODO(dtroyer): Remove Q_AGENT_EXTRA_AGENT_OPTS after stable/juno branch is cut
1397
+    if [[ -n "$Q_AGENT_EXTRA_AGENT_OPTS" ]]; then
1398
+        echo ""
1399
+        echo_summary "WARNING: Q_AGENT_EXTRA_AGENT_OPTS is used"
1400
+        echo "You are using Q_AGENT_EXTRA_AGENT_OPTS to pass configuration into $NEUTRON_CONF."
1401
+        echo "Please convert that configuration in localrc to a $NEUTRON_CONF section in local.conf:"
1402
+        echo "Q_AGENT_EXTRA_AGENT_OPTS will be removed early in the 'K' development cycle"
1403
+        echo "
1403 1404
 [[post-config|/\$Q_PLUGIN_CONF_FILE]]
1404 1405
 [DEFAULT]
1405 1406
 "
1406
-    for I in "${Q_AGENT_EXTRA_AGENT_OPTS[@]}"; do
1407
-        # Replace the first '=' with ' ' for iniset syntax
1408
-        echo ${I}
1409
-    done
1410
-fi
1407
+        for I in "${Q_AGENT_EXTRA_AGENT_OPTS[@]}"; do
1408
+            # Replace the first '=' with ' ' for iniset syntax
1409
+            echo ${I}
1410
+        done
1411
+    fi
1411 1412
 
1412
-# TODO(dtroyer): Remove Q_AGENT_EXTRA_SRV_OPTS after stable/juno branch is cut
1413
-if [[ -n "$Q_AGENT_EXTRA_SRV_OPTS" ]]; then
1414
-    echo ""
1415
-    echo_summary "WARNING: Q_AGENT_EXTRA_SRV_OPTS is used"
1416
-    echo "You are using Q_AGENT_EXTRA_SRV_OPTS to pass configuration into $NEUTRON_CONF."
1417
-    echo "Please convert that configuration in localrc to a $NEUTRON_CONF section in local.conf:"
1418
-    echo "Q_AGENT_EXTRA_AGENT_OPTS will be removed early in the 'K' development cycle"
1419
-    echo "
1413
+    # TODO(dtroyer): Remove Q_AGENT_EXTRA_SRV_OPTS after stable/juno branch is cut
1414
+    if [[ -n "$Q_AGENT_EXTRA_SRV_OPTS" ]]; then
1415
+        echo ""
1416
+        echo_summary "WARNING: Q_AGENT_EXTRA_SRV_OPTS is used"
1417
+        echo "You are using Q_AGENT_EXTRA_SRV_OPTS to pass configuration into $NEUTRON_CONF."
1418
+        echo "Please convert that configuration in localrc to a $NEUTRON_CONF section in local.conf:"
1419
+        echo "Q_AGENT_EXTRA_AGENT_OPTS will be removed early in the 'K' development cycle"
1420
+        echo "
1420 1421
 [[post-config|/\$Q_PLUGIN_CONF_FILE]]
1421 1422
 [DEFAULT]
1422 1423
 "
1423
-    for I in "${Q_AGENT_EXTRA_SRV_OPTS[@]}"; do
1424
-        # Replace the first '=' with ' ' for iniset syntax
1425
-        echo ${I}
1426
-    done
1424
+        for I in "${Q_AGENT_EXTRA_SRV_OPTS[@]}"; do
1425
+            # Replace the first '=' with ' ' for iniset syntax
1426
+            echo ${I}
1427
+        done
1428
+    fi
1427 1429
 fi
1428 1430
 
1429
-# TODO(dtroyer): Remove CINDER_MULTI_LVM_BACKEND after stable/juno branch is cut
1430
-if [[ "$CINDER_MULTI_LVM_BACKEND" = "True" ]]; then
1431
-    echo ""
1432
-    echo_summary "WARNING: CINDER_MULTI_LVM_BACKEND is used"
1433
-    echo "You are using CINDER_MULTI_LVM_BACKEND to configure Cinder's multiple LVM backends"
1434
-    echo "Please convert that configuration in local.conf to use CINDER_ENABLED_BACKENDS."
1435
-    echo "CINDER_ENABLED_BACKENDS will be removed early in the 'K' development cycle"
1436
-    echo "
1431
+if is_service_enabled cinder; then
1432
+    # TODO(dtroyer): Remove CINDER_MULTI_LVM_BACKEND after stable/juno branch is cut
1433
+    if [[ "$CINDER_MULTI_LVM_BACKEND" = "True" ]]; then
1434
+        echo ""
1435
+        echo_summary "WARNING: CINDER_MULTI_LVM_BACKEND is used"
1436
+        echo "You are using CINDER_MULTI_LVM_BACKEND to configure Cinder's multiple LVM backends"
1437
+        echo "Please convert that configuration in local.conf to use CINDER_ENABLED_BACKENDS."
1438
+        echo "CINDER_ENABLED_BACKENDS will be removed early in the 'K' development cycle"
1439
+        echo "
1437 1440
 [[local|localrc]]
1438 1441
 CINDER_ENABLED_BACKENDS=lvm:lvmdriver-1,lvm:lvmdriver-2
1439 1442
 "
1443
+    fi
1440 1444
 fi
1441 1445
 
1442 1446
 # Indicate how long this took to run (bash maintained variable ``SECONDS``)