ctdb-scripts: CTDB_BASE must be set when including functions file
authorMartin Schwenke <martin@meltin.net>
Mon, 17 Aug 2015 04:01:40 +0000 (14:01 +1000)
committerMichael Adam <obnox@samba.org>
Tue, 15 Sep 2015 06:56:21 +0000 (08:56 +0200)
Also fix an unused test to set CTDB_BASE.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
ctdb/config/functions
ctdb/tests/test_check_tcp_ports.sh

index 35ccb009af8486e0fcbdd6062866535bf36458a4..85d062cf201618e37a9ea13da96070725621cab0 100755 (executable)
@@ -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
index e439b6d3744b87d0a50ed64deeb87894932de62e..1272d885c59ad3283243e16ff99e916fec6f1e61 100755 (executable)
@@ -2,7 +2,8 @@
 
 DIRNAME=$(dirname $0)
 
-. ${DIRNAME}/../config/functions
+CTDB_BASE="${DIRNAME}/../config"
+. "${CTDB_BASE}/functions"
 
 SERVICE="test-service"