From 5ef32c57f327e1dd4e9d227b9c8fd4b6f6fb4970 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 11 Aug 2016 10:10:25 +0000 Subject: 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 Reviewed-on: http://review.gluster.org/15146 Reviewed-by: Anuradha Talur Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- heal/src/glfs-heal.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'heal/src/glfs-heal.c') 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; } -- cgit