summaryrefslogtreecommitdiffstats
path: root/heal/src
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-11 23:25:30 -0700
commit5ef32c57f327e1dd4e9d227b9c8fd4b6f6fb4970 (patch)
treebf106b3388a9d25110ead5e479abd616f68339bf /heal/src
parentd7c7f87ee3f442ef24cbffb30df289bb26b20a5d (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. Change-Id: I16347eb4455b9bcc7a9b0127f8783140b6016578 BUG: 1366222 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/15146 Reviewed-by: Anuradha Talur <atalur@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'heal/src')
-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;
}