]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Drop dependency on variable ctdb_test_restart_scheduled
authorMartin Schwenke <martin@meltin.net>
Mon, 8 Oct 2018 02:53:16 +0000 (13:53 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 6 Nov 2018 06:16:16 +0000 (07:16 +0100)
The remainder of the scheduled restart logic is about to be removed,
so produce debugging information any time the cluster is not healthy.

While here, reindent and drop the else since there is already an early
return before it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/scripts/integration.bash

index 4202829f2cc1f45faf392bf5ecb376e3c7590a8d..f53dd76c909f4452d009adc7bebe17d1565689d0 100644 (file)
@@ -288,24 +288,25 @@ _cluster_is_ready ()
 
 cluster_is_healthy ()
 {
-    if onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then
-       echo "Cluster is HEALTHY"
-       if ! onnode 0 $CTDB_TEST_WRAPPER _cluster_is_recovered ; then
-         echo "WARNING: cluster in recovery mode!"
+       if onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then
+               echo "Cluster is HEALTHY"
+               if ! onnode 0 $CTDB_TEST_WRAPPER _cluster_is_recovered ; then
+                       echo "WARNING: cluster in recovery mode!"
+               fi
+               return 0
        fi
-       return 0
-    else
+
        echo "Cluster is UNHEALTHY"
-       if ! ${ctdb_test_restart_scheduled:-false} ; then
-           echo "DEBUG AT $(date '+%F %T'):"
-           local i
-           for i in "onnode -q 0 $CTDB status" "onnode -q 0 onnode all $CTDB scriptstatus" ; do
+
+       echo "DEBUG AT $(date '+%F %T'):"
+       local i
+       for i in "onnode -q 0 $CTDB status" \
+                        "onnode -q 0 onnode all $CTDB scriptstatus" ; do
                echo "$i"
                $i || true
-           done
-       fi
+       done
+
        return 1
-    fi
 }
 
 wait_until_ready ()