ctdb-tools: Drop onnode node specifications for recmaster/lvs/natgw
authorMartin Schwenke <martin@meltin.net>
Mon, 18 Apr 2016 06:59:53 +0000 (16:59 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 25 Apr 2016 08:34:47 +0000 (10:34 +0200)
LVS and NAT gateway support had bit-rotted.  We don't use any of these
in scripts/tests and we very much doubt anyone else uses them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Apr 25 10:34:47 CEST 2016 on sn-devel-144

ctdb/doc/onnode.1.xml
ctdb/tests/onnode/0080.sh [deleted file]
ctdb/tests/onnode/0081.sh [deleted file]
ctdb/tests/onnode/0090.sh [deleted file]
ctdb/tests/onnode/0091.sh [deleted file]
ctdb/tools/onnode

index 02898d2d65da49c2cebaefb98136e06805cc724b..d55f771c021eaba3c7f517374e42b7b414915265 100644 (file)
          </para>
         </listitem>
       </varlistentry>
-      <varlistentry><term>lvs | lvsmaster</term>
-        <listitem>
-          <para>
-            The current LVS master.
-         </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry><term>natgw | natgwlist</term>
-        <listitem>
-          <para>
-            The current NAT gateway.
-         </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry><term>rm | recmaster</term>
-        <listitem>
-          <para>
-            The current recovery master.
-         </para>
-        </listitem>
-      </varlistentry>
     </variablelist>
   </refsect1>
 
diff --git a/ctdb/tests/onnode/0080.sh b/ctdb/tests/onnode/0080.sh
deleted file mode 100755 (executable)
index bca478a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-. "${TEST_SCRIPTS_DIR}/unit.sh"
-
-cmd="$ONNODE recmaster hostname"
-
-define_test "$cmd" "node 1 (192.168.1.102) is recmaster"
-
-ctdb_set_output <<EOF
-1
-EOF
-
-required_result <<EOF
--n 192.168.1.102 hostname
-EOF
-
-simple_test $cmd
diff --git a/ctdb/tests/onnode/0081.sh b/ctdb/tests/onnode/0081.sh
deleted file mode 100755 (executable)
index 412db87..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-. "${TEST_SCRIPTS_DIR}/unit.sh"
-
-cmd="$ONNODE lvsmaster hostname"
-
-define_test "$cmd" "no lvsmaster"
-
-ctdb_set_output 255 <<EOF
-There is no LVS master
-EOF
-
-required_result 1 <<EOF
-onnode: No lvsmaster available
-EOF
-
-simple_test $cmd
diff --git a/ctdb/tests/onnode/0090.sh b/ctdb/tests/onnode/0090.sh
deleted file mode 100755 (executable)
index dd50c51..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-. "${TEST_SCRIPTS_DIR}/unit.sh"
-
-cmd="$ONNODE natgw hostname"
-
-define_test "$cmd" "no natgw"
-
-ctdb_set_output <<EOF
--1 0.0.0.0
-:0:192.168.1.101:0:0:0:0:0:
-:1:192.168.1.102:0:0:0:0:0:
-:2:192.168.1.103:0:0:0:0:0:
-:3:192.168.1.104:0:0:0:0:0:
-EOF
-
-required_result 1 <<EOF
-onnode: No natgwlist available
-EOF
-
-simple_test $cmd
diff --git a/ctdb/tests/onnode/0091.sh b/ctdb/tests/onnode/0091.sh
deleted file mode 100755 (executable)
index 528eec1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-. "${TEST_SCRIPTS_DIR}/unit.sh"
-
-cmd="$ONNODE natgw hostname"
-
-define_test "$cmd" "node 2 (192.168.1.103) is natgw"
-
-ctdb_set_output <<EOF
-2 192.168.1.103
-:0:192.168.1.101:0:0:0:0:0:
-:1:192.168.1.102:0:0:0:0:0:
-:2:192.168.1.103:0:0:0:0:0:
-:3:192.168.1.104:0:0:0:0:0:
-EOF
-
-required_result <<EOF
--n 192.168.1.103 hostname
-EOF
-
-simple_test $cmd
index 104295ebac6b7b74b1f3018ec26c16347cae92f3..9b1a5803573287b0a647c42860f54b071668b142 100755 (executable)
@@ -39,9 +39,7 @@ Usage: onnode [OPTION] ... <NODES> <COMMAND> ...
     -P          Push given files to nodes instead of running commands.
     -q          Do not print node addresses (overrides -v).
     -v          Print node address even for a single node.
-  <NODES>       "all", "any", "ok" (or "healthy"), "con" (or "connected"),
-                "rm" (or "recmaster"), "lvs" (or "lvsmaster"),
-                "natgw" (or "natgwlist"); or
+  <NODES>       "all", "any", "ok" (or "healthy"), "con" (or "connected") ; or
                 a node number (0 base); or
                 a hostname (if -n is specified); or
                 list (comma separated) of <NODES>; or
@@ -132,9 +130,7 @@ parse_nodespec ()
        for i in $1 ; do
            case "$i" in
                *-*) seq "${i%-*}" "${i#*-}" 2>/dev/null || invalid_nodespec ;;
-               # Separate lines for readability.
                all|any|ok|healthy|con|connected) echo "$i" ;;
-               rm|recmaster|lvs|lvsmaster|natgw|natgwlist) echo "$i" ;;
                *)
                    [ $i -gt -1 ] 2>/dev/null || $names_ok || invalid_nodespec
                    echo $i
@@ -192,52 +188,6 @@ get_nodes_with_status ()
     )
 }
 
-ctdb_props="" # cache
-get_node_with_property ()
-{
-    local all_nodes="$1"
-    local prop="$2"
-
-    local prop_node=""
-    if [ "${ctdb_props##:${prop}:}" = "$ctdb_props" ] ; then
-       # Not in cache.
-       prop_node=$(ctdb "$prop" -X 2>/dev/null)
-       if [ $? -eq 0 ] ; then
-           if [ "$prop" = "natgwlist" ] ; then
-               prop_node="${prop_node%% *}" # 1st word
-               if [ "$prop_node" = "-1" ] ; then
-                   # This works around natgwlist returning 0 even
-                   # when there's no natgw.
-                   prop_node=""
-               fi
-           else
-               # We only want the first line.
-               local nl="
-"
-               prop_node="${prop_node%%${nl}*}"
-           fi
-       else
-           prop_node=""
-       fi
-
-       if [ -n "$prop_node" ] ; then
-           # Add to cache.
-           ctdb_props="${ctdb_props}${ctdb_props:+ }:${prop}:${prop_node}"
-       fi
-    else
-       # Get from cache.
-       prop_node="${ctdb_props##:${prop}:}"
-       prop_node="${prop_node%% *}"
-    fi
-
-    if [ -n "$prop_node" ] ; then
-       echo_nth "$prop_node" $all_nodes
-    else
-       echo "${prog}: No ${prop} available" >&2
-       exit 1
-    fi
-}
-
 get_any_available_node ()
 {
     local all_nodes="$1"
@@ -299,15 +249,6 @@ get_nodes ()
            con|connected) 
                get_nodes_with_status "$all_nodes" "connected" || exit 1
                ;;
-           rm|recmaster)
-               get_node_with_property "$all_nodes" "recmaster" || exit 1
-               ;;
-           lvs|lvsmaster)
-               get_node_with_property "$all_nodes" "lvsmaster" || exit 1
-               ;;
-           natgw|natgwlist)
-               get_node_with_property "$all_nodes" "natgwlist" || exit 1
-               ;;
            [0-9]|[0-9][0-9]|[0-9][0-9][0-9])
                echo_nth $n $all_nodes
                ;;