From 55df9c86c19e261a2a384ffc4b77c596c84e53a0 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Thu, 20 Nov 2014 14:39:59 +1100 Subject: [PATCH] ctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X Also update onnode unit tests. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tests/onnode/0070.sh | 10 +++++----- ctdb/tests/onnode/0071.sh | 10 +++++----- ctdb/tests/onnode/0072.sh | 10 +++++----- ctdb/tests/onnode/0075.sh | 10 +++++----- ctdb/tests/onnode/stubs/onnode-buggy-001 | 12 ++++++------ ctdb/tools/ctdb_diagnostics | 2 +- ctdb/tools/onnode | 6 +++--- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ctdb/tests/onnode/0070.sh b/ctdb/tests/onnode/0070.sh index b071e80a800..d649f82f217 100755 --- a/ctdb/tests/onnode/0070.sh +++ b/ctdb/tests/onnode/0070.sh @@ -7,11 +7,11 @@ cmd="$ONNODE ok hostname" define_test "$cmd" "all nodes OK" ctdb_set_output </dev/null) + ctdb_status_output=$(ctdb -X status 2>/dev/null) if [ $? -ne 0 ] ; then echo "${prog}: unable to get status of CTDB nodes" >&2 exit 1 @@ -164,14 +164,14 @@ get_nodes_with_status () local i for i in $ctdb_status_output ; do # Try removing bits from end. - local t="${i%:${bits}:}" + local t="${i%|${bits}|}" if [ "$t" != "$i" ] ; then # Succeeded. Get address. NOTE: this is an optimisation. # It might be better to get the node number and then get # the nth node to get the address. This would make things # more consistent if $ctdb_base/nodes actually contained # hostnames. - nodes="${nodes} ${t#:*:}" + nodes="${nodes} ${t#|*|}" fi done @@ -186,7 +186,7 @@ get_node_with_property () local prop_node="" if [ "${ctdb_props##:${prop}:}" = "$ctdb_props" ] ; then - prop_node=$(ctdb "$prop" -Y 2>/dev/null) + prop_node=$(ctdb "$prop" -X 2>/dev/null) # We only want the first line. local nl=" " diff --git a/ctdb/tools/ctdb_diagnostics b/ctdb/tools/ctdb_diagnostics index 2a51e1bac25..3f2fa630f78 100755 --- a/ctdb/tools/ctdb_diagnostics +++ b/ctdb/tools/ctdb_diagnostics @@ -17,7 +17,7 @@ EOF } -nodes=$(ctdb listnodes -Y | cut -d: -f2) +nodes=$(ctdb listnodes -X | cut -d'|' -f2) bad_nodes="" diff_opts= no_ads=false diff --git a/ctdb/tools/onnode b/ctdb/tools/onnode index 33d0e20779d..96d569a2644 100755 --- a/ctdb/tools/onnode +++ b/ctdb/tools/onnode @@ -145,7 +145,7 @@ get_nodes_with_status () local status="$2" if [ -z "$ctdb_status_output" ] ; then - ctdb_status_output=$(ctdb -Y status 2>&1) + ctdb_status_output=$(ctdb -X status 2>&1) if [ $? -ne 0 ] ; then echo "${prog}: unable to get status of CTDB nodes" >&2 echo "$ctdb_status_output" >&2 @@ -158,7 +158,7 @@ get_nodes_with_status () ( local i - IFS="${IFS}:" + IFS="${IFS}|" while IFS="" read i ; do set -- $i # split line on colons @@ -196,7 +196,7 @@ get_node_with_property () local prop_node="" if [ "${ctdb_props##:${prop}:}" = "$ctdb_props" ] ; then # Not in cache. - prop_node=$(ctdb "$prop" -Y 2>/dev/null) + prop_node=$(ctdb "$prop" -X 2>/dev/null) if [ $? -eq 0 ] ; then if [ "$prop" = "natgwlist" ] ; then prop_node="${prop_node%% *}" # 1st word -- 2.11.4.GIT