From c1dbf10562796c7006fd0a66c6cb39a1b990c8c1 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 22 Jan 2015 14:09:00 +0000 Subject: [PATCH] Exit after printing error about RPC config When finding an invalid RPC configuration, devstack prints a suitable error in the logs ERROR: only one rpc backend may be enabled, set only one of 'rabbit', 'qpid', 'zeromq' via ENABLED_SERVICES. but then just carries on running, as a result the developer is very unlikely to ever see the original error message. Change the 'echo' to a 'die' so that it stop immediately making the error message clearly visible. Change-Id: If108f314e1ad2ecc79f41cbca47d08c4024a23cd --- lib/rpc_backend | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/rpc_backend b/lib/rpc_backend index d87d6207b1..98be1844b6 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -54,13 +54,15 @@ function check_rpc_backend { (( rpc_backend_cnt++ )) || true done if [ "$rpc_backend_cnt" -gt 1 ]; then - echo "ERROR: only one rpc backend may be enabled," - echo " set only one of 'rabbit', 'qpid', 'zeromq'" - echo " via ENABLED_SERVICES." + die $LINENO \ + "Only one rpc backend may be enabled, " \ + "set only one of 'rabbit', 'qpid', 'zeromq' " \ + "via ENABLED_SERVICES." elif [ "$rpc_backend_cnt" == 0 ] && [ "$rpc_needed" == 0 ]; then - echo "ERROR: at least one rpc backend must be enabled," - echo " set one of 'rabbit', 'qpid', 'zeromq'" - echo " via ENABLED_SERVICES." + die $LINENO \ + "at least one rpc backend must be enabled, " \ + "set one of 'rabbit', 'qpid', 'zeromq'" \ + "via ENABLED_SERVICES." fi if is_service_enabled qpid && ! qpid_is_supported; then