Fix lvsmaster and natgwlist nodespecs.
authorMartin Schwenke <martin@meltin.net>
Mon, 11 May 2009 04:43:17 +0000 (14:43 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 11 May 2009 22:58:57 +0000 (08:58 +1000)
They both need to use a -Y option to ctdb and for natgwlist we only
want the 1st line.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tools/onnode

index b3fae33b3297cd9a034f5e4de90e9bb3318db2e1..d7adbb05af3a2eaf3e99dfc37e42b172fcd00ef7 100755 (executable)
@@ -176,7 +176,11 @@ get_node_with_property ()
 
     local prop_node=""
     if [ "${ctdb_props##:${prop}:}" = "$ctdb_props" ] ; then
-       prop_node=$(ctdb "$prop" 2>/dev/null)
+       prop_node=$(ctdb "$prop" -Y 2>/dev/null)
+       # We only want the first line.
+       local nl="
+"
+       prop_node="${prop_node%%${nl}*}"
        if [ $? -eq 0 ] ; then
            ctdb_props="${ctdb_props}${ctdb_props:+ }:${prop}:${prop_node}"
        else