1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-lvs: Allow override of CTDB for testing

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-04-27 01:43:39 +10:00 committed by Amitay Isaacs
parent 63f7466490
commit 60d0725f1f

View File

@ -12,6 +12,10 @@ loadconfig "ctdb"
[ -n "$CTDB_SOCKET" ] && export CTDB_SOCKET
if [ -z "$CTDB" ] ; then
CTDB=ctdb
fi
############################################################
usage ()
@ -34,16 +38,16 @@ get_nodestatus_X ()
{
# Result is cached in global variable nodestatus_X
[ -n "$nodestatus_X" ] || \
nodestatus_X=$(ctdb -X nodestatus all |
nodestatus_X=$($CTDB -X nodestatus all |
sed -e '1d' -e 's@^|@@' -e 's@|$@@')
}
get_nodestatus ()
{
# Result is cached in global variable nodestatus
[ -n "$nodestatus" ] || nodestatus=$(ctdb nodestatus all)
[ -n "$nodestatus" ] || nodestatus=$($CTDB nodestatus all)
case $? in
# ctdb nodestatus returns 255 on failure
# $CTDB nodestatus returns 255 on failure
0|255) return 0 ;;
*) return 1 ;;
esac