The branch, master has been updated
via ade5353 ctdb-tests: Add some extra tests for "ctdb nodestatus"
via 1d10c8e ctdb-tools: "ctdb nodestatus" should only display header
for "all"
via a600d46 ctdb-tools: Stop "ctdb nodestatus" from always showing all
nodes
from fa6753d libnet join: Fix error handling on
provision_store_self_join failure
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -
commit ade535371b86294c12ca3f7eb98d8ef7ecd29caa
Author: Martin Schwenke
Date: Wed May 24 20:21:55 2017 +1000
ctdb-tests: Add some extra tests for "ctdb nodestatus"
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802
Signed-off-by: Martin Schwenke
Reviewed-by: Amitay Isaacs
Autobuild-User(master): Martin Schwenke
Autobuild-Date(master): Fri May 26 05:24:34 CEST 2017 on sn-devel-144
commit 1d10c8e9e637619b754b4a273d3c714fbca7d503
Author: Martin Schwenke
Date: Wed May 24 20:27:58 2017 +1000
ctdb-tools: "ctdb nodestatus" should only display header for "all"
The "Number of nodes:" header should only be displayed when "all" is
specified. This is how the command behaved in Samba <= 4.4.
Printing the number of nodes is not helpful and is rather confusing in
the default case where only the status of the current node is printed.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802
Signed-off-by: Martin Schwenke
Reviewed-by: Amitay Isaacs
commit a600d467e2842ab05e429c5a67be5b222ddd1c12
Author: Martin Schwenke
Date: Wed May 24 20:24:54 2017 +1000
ctdb-tools: Stop "ctdb nodestatus" from always showing all nodes
Exit code should only reflect current or specified nodes too.
Drop an unwanted call to get_nodemap() that overwrites the previously
calculated node map.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12802
Signed-off-by: Martin Schwenke
Reviewed-by: Amitay Isaacs
---
Summary of changes:
...db.nodestatus.001.sh => ctdb.nodestatus.003.sh} | 12 +++
...db.nodestatus.001.sh => ctdb.nodestatus.004.sh} | 13 +++
ctdb/tests/tool/ctdb.nodestatus.005.sh | 28 +++
ctdb/tests/tool/ctdb.nodestatus.006.sh | 40 ++
ctdb/tools/ctdb.c | 29 +---
5 files changed, 94 insertions(+), 28 deletions(-)
copy ctdb/tests/tool/{ctdb.nodestatus.001.sh => ctdb.nodestatus.003.sh} (73%)
copy ctdb/tests/tool/{ctdb.nodestatus.001.sh => ctdb.nodestatus.004.sh} (64%)
create mode 100755 ctdb/tests/tool/ctdb.nodestatus.005.sh
create mode 100755 ctdb/tests/tool/ctdb.nodestatus.006.sh
Changeset truncated at 500 lines:
diff --git a/ctdb/tests/tool/ctdb.nodestatus.001.sh
b/ctdb/tests/tool/ctdb.nodestatus.003.sh
similarity index 73%
copy from ctdb/tests/tool/ctdb.nodestatus.001.sh
copy to ctdb/tests/tool/ctdb.nodestatus.003.sh
index 2217afc..5912e65 100755
--- a/ctdb/tests/tool/ctdb.nodestatus.001.sh
+++ b/ctdb/tests/tool/ctdb.nodestatus.003.sh
@@ -2,11 +2,11 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
-define_test "all, 3 nodes, all OK"
+define_test "all, 3 nodes, 1 unhealthy"
setup_ctdbd num, num_deleted_nodes);
+ if (print_header) {
+ if (num_deleted_nodes == 0) {
+ printf("Number of nodes:%d\n", nodemap->num);
+ } else {
+ printf("Number of nodes:%d "
+ "(including %d deleted nodes)\n",
+ nodemap->num, num_deleted_nodes);
+ }
}
for (i=0; inum; i++) {
@@ -844,7 +848,7 @@ static void print_status(TALLOC_CTX *mem_ctx, struct
ctdb_context *ctdb,
{
int i;
- print_nodemap(mem_ctx, ctdb, nodemap, mypnn);
+ print_nodemap(mem_ctx, ctdb, nodemap, mypnn, true);
if (vnnmap->generation == INVALID_GENERATION) {
printf("Generation:INVALID\n");
@@ -5651,6 +5655,7 @@ static int control_nodestatus(TALLOC_CTX *mem_ctx, struct
ctdb_context *ctdb,
const char *nodestring = NULL;
struct ctdb_node_map *nodemap;
int ret, i;
+ bool print_hdr = false;
if (argc > 1) {
usage("nodestatus");
@@ -5658,21 +5663,19 @@ static int control_nodestatus(TALLOC_CTX *mem_ctx,
struct ctdb_context *ctdb,
if (argc == 1) {
nodestring = argv[0];
+ if (strcmp(nodestring, "all") == 0) {
+ print_hdr = true;
+