From dedc9eab92140d328550fcb76c6504677630e841 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 14 Mar 2018 15:31:36 +1100 Subject: [PATCH] ctdb-tools: No longer honour CTDB_NODES environment variable Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tools/ctdb.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 6110cc12dbe..0efd71e437f 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -479,17 +479,14 @@ static struct ctdb_node_map *read_nodes_file(TALLOC_CTX *mem_ctx, uint32_t pnn) struct ctdb_node_map *nodemap; const char *nodes_list = NULL; - nodes_list = getenv("CTDB_NODES"); + const char *basedir = getenv("CTDB_BASE"); + if (basedir == NULL) { + basedir = CTDB_ETCDIR; + } + nodes_list = talloc_asprintf(mem_ctx, "%s/nodes", basedir); if (nodes_list == NULL) { - const char *basedir = getenv("CTDB_BASE"); - if (basedir == NULL) { - basedir = CTDB_ETCDIR; - } - nodes_list = talloc_asprintf(mem_ctx, "%s/nodes", basedir); - if (nodes_list == NULL) { - fprintf(stderr, "Memory allocation error\n"); - return NULL; - } + fprintf(stderr, "Memory allocation error\n"); + return NULL; } nodemap = ctdb_read_nodes_file(mem_ctx, nodes_list); -- 2.34.1