]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Drop function ctdb_check_counter()
authorMartin Schwenke <martin@meltin.net>
Wed, 6 Jul 2016 05:11:43 +0000 (15:11 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 21 Jul 2016 00:24:25 +0000 (02:24 +0200)
It is no longer used and adds needless complexity.

As a side-effect, the functions file can now be parsed by shellcheck.

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

index 9b4e479c631072c664d81d8c99f9257ef8045e90..ac4212e3fad93b39a42e99ed2850db1817f97ccb 100755 (executable)
@@ -765,37 +765,6 @@ ctdb_counter_get () {
     # unary counting!
     stat -c "%s" "$_counter_file" 2>/dev/null || echo 0
 }
-ctdb_check_counter () {
-    _msg="${1:-error}"  # "error"  - anything else is silent on fail
-    _op="${2:--ge}"  # an integer operator supported by test
-    _limit="${3:-${service_fail_limit}}"
-    if [ $# -le 3 ] ; then
-           shift $#
-    else
-           shift 3
-    fi
-
-    _size=$(ctdb_counter_get "$1")
-
-    _hit=false
-    if [ "$_op" != "%" ] ; then
-       if [ $_size $_op $_limit ] ; then
-           _hit=true
-       fi
-    else
-       if [ $(($_size $_op $_limit)) -eq 0 ] ; then
-           _hit=true
-       fi
-    fi
-    if $_hit ; then
-       if [ "$_msg" = "error" ] ; then
-           echo "ERROR: $_size consecutive failures for $_service_name, marking node unhealthy"
-           exit 1              
-       else
-           return 1
-       fi
-    fi
-}
 
 ########################################################
 
@@ -1317,5 +1286,4 @@ update_tickles ()
 }
 
 script_name="${0##*/}"       # basename
-service_fail_limit=1
 event_name="$1"