diff options
author | Samikshan Bairagya <samikshan@gmail.com> | 2016-03-29 16:24:07 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-06-21 00:11:06 -0700 |
commit | a6e551122c603ab0cba798e7e2b30d3a15191b68 (patch) | |
tree | 270790caeac909da89ea9753c2048b7efb2c9ae4 /cli/src | |
parent | 4797ca3778d82a671716d4913c14f285591ae959 (diff) |
Fix opRet value for volume info --xml call on non-existent volume
The opRet field was being assigned to 0 in the XML output when a
gluster volume info --xml call is made on a non-existent volume.
This change assigns a value of -1 to opRet for volume info calls
for non-existent volumes. Other fields like opErrno and opErrstr
are also assigned relevant values
Change-Id: I3920c602328f74252c87bb521f5a43d4bdc7d44d
BUG: 1321836
Signed-off-by: Samikshan Bairagya <samikshan@gmail.com>
Reviewed-on: http://review.gluster.org/13843
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: darshan n <dnarayan@redhat.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 12776065128..de3a382869d 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -815,11 +815,6 @@ gf_cli_get_volume_cbk (struct rpc_req *req, struct iovec *iov, gf_log ("cli", GF_LOG_INFO, "Received resp to get vol: %d", rsp.op_ret); - if (rsp.op_ret) { - ret = -1; - goto out; - } - if (!rsp.dict.dict_len) { if (global_state->mode & GLUSTER_MODE_XML) goto xml_output; @@ -869,6 +864,13 @@ gf_cli_get_volume_cbk (struct rpc_req *req, struct iovec *iov, } } + if (rsp.op_ret) { + if (global_state->mode & GLUSTER_MODE_XML) + goto xml_output; + ret = -1; + goto out; + } + xml_output: if (global_state->mode & GLUSTER_MODE_XML) { /* For GET_NEXT_VOLUME output is already begun in |