diff options
author | Sanju Rakonde <srakonde@redhat.com> | 2017-11-09 13:15:51 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2017-11-14 15:33:00 +0000 |
commit | 9cd710e74596950aef92c8ebdc706cdd72af73b2 (patch) | |
tree | b93bead8367d52639a87bb7b15d79970436479c5 | |
parent | f249555338d0a826d63f01a0c895f53a6cb92e65 (diff) |
glusterd: display gluster volume status, when quorum type is server
Problem: when server-quorum-type is server, after restarting glusterd
in the node which is up, gluster volume status is giving incorrect
information.
Fix: check whether server is blank, before adding other keys into the
dictionary.
Change-Id: I926ebdffab330ccef844f23f6d6556e137914047
BUG: 1511768
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
(cherry picked from commit 046c7e3199fca715592762e271e6061ac99b0c4b)
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index f211f199ce6..0ca705c11db 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5051,6 +5051,12 @@ glusterd_add_node_to_dict (char *server, dict_t *dict, int count, * the brick as hostname+path, so this will make more sense * when output. */ + + if (!strcmp(server, "")) { + ret = 0; + goto out; + } + snprintf (key, sizeof (key), "brick%d.hostname", count); if (!strcmp (server, priv->nfs_svc.name)) ret = dict_set_str (dict, key, "NFS Server"); |