From: Martin Schwenke Date: Mon, 18 Apr 2016 06:59:53 +0000 (+1000) Subject: ctdb-tools: Drop onnode node specifications for recmaster/lvs/natgw X-Git-Tag: talloc-2.1.7~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c373f2854a3414680ce71e8738b429a60b70fd3;p=thirdparty%2Fsamba.git ctdb-tools: Drop onnode node specifications for recmaster/lvs/natgw 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 Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Mon Apr 25 10:34:47 CEST 2016 on sn-devel-144 --- diff --git a/ctdb/doc/onnode.1.xml b/ctdb/doc/onnode.1.xml index 02898d2d65d..d55f771c021 100644 --- a/ctdb/doc/onnode.1.xml +++ b/ctdb/doc/onnode.1.xml @@ -196,27 +196,6 @@ - lvs | lvsmaster - - - The current LVS master. - - - - natgw | natgwlist - - - The current NAT gateway. - - - - rm | recmaster - - - The current recovery master. - - - diff --git a/ctdb/tests/onnode/0080.sh b/ctdb/tests/onnode/0080.sh deleted file mode 100755 index bca478ada5f..00000000000 --- a/ctdb/tests/onnode/0080.sh +++ /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 < ... -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. - "all", "any", "ok" (or "healthy"), "con" (or "connected"), - "rm" (or "recmaster"), "lvs" (or "lvsmaster"), - "natgw" (or "natgwlist"); or + "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 ; 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 ;;