diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2016-09-02 10:42:44 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-09-09 01:20:47 -0700 |
commit | 213eadbb51ad1ff4b012113a8e1066b758a4e635 (patch) | |
tree | b4a05b3095dff3b2c980ca2d2843ffc619996923 /cli | |
parent | 0587f334e2e4fd71ad61f65db10ffe1b1ad5d1f9 (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: 1374298
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/15430
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Samikshan Bairagya <samikshan@gmail.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index d683457ed25..d1df07219e3 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -8152,7 +8152,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) { @@ -8161,17 +8161,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) { @@ -8420,7 +8421,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; } } @@ -8457,6 +8458,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); } |