summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-09-02 10:42:44 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-11-14 03:09:36 -0800
commita4ecc73a5cd7029dd5ad4a8545a4ec41365ffce9 (patch)
treefe04f19fc6f9e2b7003509aa53b51f274fe1f9c7
parent6a401f152b109e1d9efb5a7801648d79eba06d3b (diff)
cli: fix volume status xml generation
While generating xml, if CLI fails in between xml output doesn't get dumped into stdout. Fix is to invoke cli_xml_output_vol_status_end () in such failures. >Reviewed-on: http://review.gluster.org/15384 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> >Smoke: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: Samikshan Bairagya <samikshan@gmail.com> >Reviewed-by: Prashanth Pai <ppai@redhat.com> Change-Id: I7cb3097f5ae23092e6d20f68bd75aa190c31ed88 BUG: 1392181 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/15820 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com>
-rw-r--r--cli/src/cli-rpc-ops.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 3a5b8e6..703026a 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -7765,7 +7765,7 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov,
if (ret) {
gf_log ("cli", GF_LOG_ERROR,
"Error outputting to xml");
- goto out;
+ goto xml_end;
}
}
if (cmd & GF_CLI_STATUS_TASKS) {
@@ -7774,17 +7774,18 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov,
if (ret) {
gf_log ("cli", GF_LOG_ERROR,"Error outputting "
"to xml");
- goto out;
+ goto xml_end;
}
} else {
ret = cli_xml_output_vol_status (local, dict);
if (ret) {
gf_log ("cli", GF_LOG_ERROR,
"Error outputting to xml");
- goto out;
+ goto xml_end;
}
}
+xml_end:
if (!local->all) {
ret = cli_xml_output_vol_status_end (local);
if (ret) {
@@ -8029,7 +8030,7 @@ gf_cli_status_volume_all (call_frame_t *frame, xlator_t *this, void *data)
if (ret) {
gf_log ("cli", GF_LOG_ERROR,
"Error outputting to xml");
- goto out;
+ goto xml_end;
}
}
@@ -8066,6 +8067,7 @@ gf_cli_status_volume_all (call_frame_t *frame, xlator_t *this, void *data)
dict_unref (dict);
}
+xml_end:
if (global_state->mode & GLUSTER_MODE_XML) {
ret = cli_xml_output_vol_status_end (local);
}