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
This commit is contained in:
Daniel P. Berrange 2015-01-22 14:09:00 +00:00
parent cc9d7330e9
commit c1dbf10562

View File

@ -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