summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-08-05 16:36:06 +0530
committerRajesh Joseph <rjoseph@redhat.com>2015-08-14 02:30:13 -0700
commit37353199483f2052b50e9d0b35257c27a08f3da4 (patch)
tree9da4482a409e5be069cf58806f5fb2e0e9349e53 /cli
parent289d00369f0ddb78f534735f7d3bf86268adac60 (diff)
xml output: Fix non-uniform opErrstr xml output
Display <opErrstr/> in case of no operrstr for all xml output of gluster commands. Change-Id: Ie16f749f90b4642357c562012408c434cd38661f BUG: 1245895 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/11835 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-xml-output.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index d41aebc8cad..b558a9a843c 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -123,8 +123,15 @@ cli_xml_output_common (xmlTextWriterPtr writer, int op_ret, int op_errno,
"%d", op_errno);
XML_RET_CHECK_AND_GOTO (ret, out);
- ret = xmlTextWriterWriteFormatElement (writer, (xmlChar *)"opErrstr",
- "%s", op_errstr);
+ if (op_errstr)
+ ret = xmlTextWriterWriteFormatElement (writer,
+ (xmlChar *)"opErrstr",
+ "%s", op_errstr);
+ else
+ ret = xmlTextWriterWriteFormatElement (writer,
+ (xmlChar *)"opErrstr",
+ "%s", "");
+
XML_RET_CHECK_AND_GOTO (ret, out);
out: