Skip to content

Commit

Permalink
ctdb-tools: No longer honour CTDB_NODES environment variable
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>
  • Loading branch information
martin-schwenke authored and Amitay Isaacs committed Mar 19, 2018
1 parent 6cf861a commit dedc9ea
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions ctdb/tools/ctdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dedc9ea

Please sign in to comment.