summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2016-08-11 10:10:25 +0000
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-08-22 04:15:09 -0700
commitc88065772c1b5c3e3a6f7b172c3471ad056d3b13 (patch)
treecdf2114de07c15537b1a1b030e8d276b432c027e
parentfebaa1e46d3a91a29c4786a17abf29cfc7178254 (diff)
glfsheal: print brick name and path even when brick is down
The xml variant of heal info command does not display brick name when the brick is down due to a failure to fetch the hostUUID. But the non xml variant does. So fixed the xml variant to print the remote_host and remote_subvol even when the brick is down. > Reviewed-on: http://review.gluster.org/15146 > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Anuradha Talur <atalur@redhat.com> > Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> BUG: 1367327 Change-Id: I16347eb4455b9bcc7a9b0127f8783140b6016578 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name> Reviewed-on: http://review.gluster.org/15173 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--heal/src/glfs-heal.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index 9865f53ce51..0a880cb752e 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -263,15 +263,11 @@ print:
(xmlChar *)"hostUuid", "%s", uuid?uuid:"-");
XML_RET_CHECK_AND_GOTO (x_ret, xml_out);
- if (ret < 0) {
- x_ret = xmlTextWriterWriteFormatElement (glfsh_writer,
- (xmlChar *)"name", "%s", "information not available");
- XML_RET_CHECK_AND_GOTO (x_ret, xml_out);
- } else {
- x_ret = xmlTextWriterWriteFormatElement (glfsh_writer,
- (xmlChar *)"name", "%s:%s", remote_host, remote_subvol);
- XML_RET_CHECK_AND_GOTO (x_ret, xml_out);
- }
+ x_ret = xmlTextWriterWriteFormatElement (glfsh_writer,
+ (xmlChar *)"name", "%s:%s",
+ remote_host ? remote_host : "-",
+ remote_subvol ? remote_subvol : "-");
+ XML_RET_CHECK_AND_GOTO (x_ret, xml_out);
xml_out:
return ret;
}