ctdb-scripts: Drop function ctdb_check_command()
authorMartin Schwenke <martin@meltin.net>
Mon, 9 Jan 2017 04:19:26 +0000 (15:19 +1100)
committerMartin Schwenke <martins@samba.org>
Mon, 16 Jan 2017 10:57:08 +0000 (11:57 +0100)
This is only used in 1 place, so just inline the check.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events.d/49.winbind
ctdb/config/functions

index c9d7aca2bc979677e11b77ae9ade76b29c9438eb..5e937378295cabf32c615e2e2a0b3b5a716806ef 100755 (executable)
@@ -48,7 +48,11 @@ shutdown)
        ;;
 
 monitor)
-       ctdb_check_command wbinfo -p
+       if ! out=$(wbinfo -p 2>&1) ; then
+               echo "ERROR: wbinfo -p returned error"
+               echo "$out"
+               exit 1
+       fi
        ;;
 esac
 
index 44e542ae11c8dd552744ac4aba46adfe095a233b..9b0c3207533ca34ba3b2091cb2dd32966ee2f80b 100755 (executable)
@@ -408,21 +408,6 @@ ctdb_check_unix_socket() {
     fi
 }
 
-######################################################
-# check a command returns zero status
-# usage: ctdb_check_command <command>
-######################################################
-ctdb_check_command ()
-{
-    _out=$("$@" 2>&1) || {
-       echo "ERROR: $* returned error"
-       if [ -n "$_out" ] ; then
-               debug "$_out"
-       fi
-       exit 1
-    }
-}
-
 ################################################
 # kill off any TCP connections with the given IP
 ################################################