Change the 'This Node' column of the machinereadable output for 'ctdb status -Y'...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 21 Sep 2011 05:41:28 +0000 (15:41 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 21 Sep 2011 05:41:28 +0000 (15:41 +1000)
1/0 is unsuitable since it can be useful to check 'if a column is "1" there is something wrong with that node'

tools/ctdb.c

index fc281e48e5c62f969132e98ed6b7345d75231c78..876521a3d4f48c7be83c9845a669c4cc386ca7f6 100644 (file)
@@ -651,7 +651,7 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
                                        talloc_free(ifaces);
                                }
                        }
-                       printf(":%d:%s:%d:%d:%d:%d:%d:%d:%d:%d:\n", nodemap->nodes[i].pnn,
+                       printf(":%d:%s:%d:%d:%d:%d:%d:%d:%d:%c:\n", nodemap->nodes[i].pnn,
                                ctdb_addr_to_str(&nodemap->nodes[i].addr),
                               !!(nodemap->nodes[i].flags&NODE_FLAGS_DISCONNECTED),
                               !!(nodemap->nodes[i].flags&NODE_FLAGS_BANNED),
@@ -660,7 +660,7 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
                               !!(nodemap->nodes[i].flags&NODE_FLAGS_STOPPED),
                               !!(nodemap->nodes[i].flags&NODE_FLAGS_INACTIVE),
                               partially_online,
-                              (nodemap->nodes[i].pnn == mypnn));
+                              (nodemap->nodes[i].pnn == mypnn)?'Y':'N');
                }
                return 0;
        }