Removes "RPC not enabled" error message when no backend is needed
When no service needing a RPC backend is activated, no error message should appear if a RPC backend is not installed. A simple check is done on the services installation files to see which services need to initialize a RPC backend at some point; if none of these services are in ENABLED_SERVICES then the error message is skipped. Change-Id: I4e47e0c675c74775b4ea53a00848ac1d777f0125 Fixes: bug #1167338
This commit is contained in:
parent
0906621356
commit
7a7a466738
@ -21,9 +21,22 @@ set +o xtrace
|
|||||||
# Functions
|
# Functions
|
||||||
# ---------
|
# ---------
|
||||||
|
|
||||||
|
|
||||||
# Make sure we only have one rpc backend enabled.
|
# Make sure we only have one rpc backend enabled.
|
||||||
# Also check the specified rpc backend is available on your platform.
|
# Also check the specified rpc backend is available on your platform.
|
||||||
function check_rpc_backend() {
|
function check_rpc_backend() {
|
||||||
|
local rpc_needed=1
|
||||||
|
# We rely on the fact that filenames in lib/* match the service names
|
||||||
|
# that can be passed as arguments to is_service_enabled.
|
||||||
|
# We check for a call to iniset_rpc_backend in these files, meaning
|
||||||
|
# the service needs a backend.
|
||||||
|
rpc_candidates=$(grep -rl iniset_rpc_backend . | awk -F/ '{print $NF}')
|
||||||
|
for c in ${rpc_candidates}; do
|
||||||
|
if is_service_enabled $c; then
|
||||||
|
rpc_needed=0
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
local rpc_backend_cnt=0
|
local rpc_backend_cnt=0
|
||||||
for svc in qpid zeromq rabbit; do
|
for svc in qpid zeromq rabbit; do
|
||||||
is_service_enabled $svc &&
|
is_service_enabled $svc &&
|
||||||
@ -33,7 +46,7 @@ function check_rpc_backend() {
|
|||||||
echo "ERROR: only one rpc backend may be enabled,"
|
echo "ERROR: only one rpc backend may be enabled,"
|
||||||
echo " set only one of 'rabbit', 'qpid', 'zeromq'"
|
echo " set only one of 'rabbit', 'qpid', 'zeromq'"
|
||||||
echo " via ENABLED_SERVICES."
|
echo " via ENABLED_SERVICES."
|
||||||
elif [ "$rpc_backend_cnt" == 0 ]; then
|
elif [ "$rpc_backend_cnt" == 0 ] && [ "$rpc_needed" == 0 ]; then
|
||||||
echo "ERROR: at least one rpc backend must be enabled,"
|
echo "ERROR: at least one rpc backend must be enabled,"
|
||||||
echo " set one of 'rabbit', 'qpid', 'zeromq'"
|
echo " set one of 'rabbit', 'qpid', 'zeromq'"
|
||||||
echo " via ENABLED_SERVICES."
|
echo " via ENABLED_SERVICES."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user