From c88065772c1b5c3e3a6f7b172c3471ad056d3b13 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. > Reviewed-on: http://review.gluster.org/15146 > Smoke: Gluster Build System > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System > Reviewed-by: Anuradha Talur > Reviewed-by: Pranith Kumar Karampuri BUG: 1367327 Change-Id: I16347eb4455b9bcc7a9b0127f8783140b6016578 Signed-off-by: Ravishankar N Signed-off-by: Oleksandr Natalenko Reviewed-on: http://review.gluster.org/15173 NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri Smoke: Gluster Build System CentOS-regression: Gluster Build System --- heal/src/glfs-heal.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'heal/src') 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