summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-08-05 16:36:06 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-08-18 03:34:03 -0700
commita17257727ce00b25ea88800c0dd54deec4d999ba (patch)
tree29d8ed79d8edbf8ebc3209312236d4cad83d1f92 /cli
parentfb601c73d366376711f5f164924a7655982e887f (diff)
xml output: Fix non-uniform opErrstr xml output
Backport of http://review.gluster.org/#/c/11835/ Display <opErrstr/> in case of no operrstr for all xml output of gluster commands Change-Id: Ie16f749f90b4642357c562012408c434cd38661f BUG: 1218732 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/11921 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: mohammed rafi kc <rkavunga@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 922711dc2be..2ff924158ce 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: