|
...
|
...
|
@@ -21,9 +21,22 @@ set +o xtrace
|
|
21
|
21
|
# Functions
|
|
22
|
22
|
# ---------
|
|
23
|
23
|
|
|
|
24
|
+
|
|
24
|
25
|
# Make sure we only have one rpc backend enabled.
|
|
25
|
26
|
# Also check the specified rpc backend is available on your platform.
|
|
26
|
27
|
function check_rpc_backend() {
|
|
|
28
|
+ local rpc_needed=1
|
|
|
29
|
+ # We rely on the fact that filenames in lib/* match the service names
|
|
|
30
|
+ # that can be passed as arguments to is_service_enabled.
|
|
|
31
|
+ # We check for a call to iniset_rpc_backend in these files, meaning
|
|
|
32
|
+ # the service needs a backend.
|
|
|
33
|
+ rpc_candidates=$(grep -rl iniset_rpc_backend . | awk -F/ '{print $NF}')
|
|
|
34
|
+ for c in ${rpc_candidates}; do
|
|
|
35
|
+ if is_service_enabled $c; then
|
|
|
36
|
+ rpc_needed=0
|
|
|
37
|
+ break
|
|
|
38
|
+ fi
|
|
|
39
|
+ done
|
|
27
|
40
|
local rpc_backend_cnt=0
|
|
28
|
41
|
for svc in qpid zeromq rabbit; do
|
|
29
|
42
|
is_service_enabled $svc &&
|
|
...
|
...
|
@@ -33,7 +46,7 @@ function check_rpc_backend() {
|
|
33
|
33
|
echo "ERROR: only one rpc backend may be enabled,"
|
|
34
|
34
|
echo " set only one of 'rabbit', 'qpid', 'zeromq'"
|
|
35
|
35
|
echo " via ENABLED_SERVICES."
|
|
36
|
|
- elif [ "$rpc_backend_cnt" == 0 ]; then
|
|
|
36
|
+ elif [ "$rpc_backend_cnt" == 0 ] && [ "$rpc_needed" == 0 ]; then
|
|
37
|
37
|
echo "ERROR: at least one rpc backend must be enabled,"
|
|
38
|
38
|
echo " set one of 'rabbit', 'qpid', 'zeromq'"
|
|
39
|
39
|
echo " via ENABLED_SERVICES."
|