From: Martin Schwenke Date: Mon, 17 Aug 2015 04:01:40 +0000 (+1000) Subject: ctdb-scripts: CTDB_BASE must be set when including functions file X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=014a1eb54008fc36890c8bcd4103fbd8053002e2;p=obnox%2Fsamba%2Fsamba-obnox.git ctdb-scripts: CTDB_BASE must be set when including functions file Also fix an unused test to set CTDB_BASE. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Reviewed-by: Jose A. Rivera Reviewed-by: Michael Adam --- diff --git a/ctdb/config/functions b/ctdb/config/functions index 35ccb009af8..85d062cf201 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -2,6 +2,11 @@ # utility functions for ctdb event scripts +if [ -z "$CTDB_BASE" ] ; then + echo 'CTDB_BASE unset in CTDB functions file' + exit 1 +fi + CTDB_VARDIR="/usr/local/var/lib/ctdb" # Only (and always) override these variables in test code diff --git a/ctdb/tests/test_check_tcp_ports.sh b/ctdb/tests/test_check_tcp_ports.sh index e439b6d3744..1272d885c59 100755 --- a/ctdb/tests/test_check_tcp_ports.sh +++ b/ctdb/tests/test_check_tcp_ports.sh @@ -2,7 +2,8 @@ DIRNAME=$(dirname $0) -. ${DIRNAME}/../config/functions +CTDB_BASE="${DIRNAME}/../config" +. "${CTDB_BASE}/functions" SERVICE="test-service"