diff options
| author | Kaushal M <kaushal@redhat.com> | 2013-09-04 13:06:57 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2013-09-11 09:28:45 -0700 | 
| commit | 7d9bc0d21408c31651a65a6ec0e67c3b8acd0fde (patch) | |
| tree | 8aef15e83431c6b1176b84d2a75a1f96f53de989 /cli | |
| parent | 4c4aaa5abf68d4da8e3c626ab7a469b81354b9e2 (diff) | |
cli: Fix 'status all' xml output when volumes are not started
CLI now only outputs one XML document for 'status all' only containing
those volumes which are started.
BUG: 1004218
Change-Id: Id4130fe59b3b74475d8bd1cc8134ac59a28f1b7e
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5773
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/src/cli-rpc-ops.c | 22 | 
1 files changed, 12 insertions, 10 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 74b7ac0c94b..a773056c3de 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -6406,10 +6406,12 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov,                                    "status information.");                  if (global_state->mode & GLUSTER_MODE_XML) { -                       cli_xml_output_str ("volStatus", msg, rsp.op_ret, -                                           rsp.op_errno, rsp.op_errstr); -                       ret = 0; -                       goto out; +                        if (!local->all) +                                cli_xml_output_str ("volStatus", msg, +                                                    rsp.op_ret, rsp.op_errno, +                                                    rsp.op_errstr); +                        ret = 0; +                        goto out;                  }                  cli_err ("%s", msg); @@ -6677,12 +6679,6 @@ gf_cli_status_volume_all (call_frame_t *frame, xlator_t *this, void *data)                  goto out;          } -        if (vol_count == 0) { -                cli_err ("No volumes present"); -                ret = 0; -                goto out; -        } -          /* remove the "all" flag in cmd */          cmd &= ~GF_CLI_STATUS_ALL;          cmd |= GF_CLI_STATUS_VOL; @@ -6697,6 +6693,12 @@ gf_cli_status_volume_all (call_frame_t *frame, xlator_t *this, void *data)                  }          } +        if (vol_count == 0 && !(global_state->mode & GLUSTER_MODE_XML)) { +                cli_err ("No volumes present"); +                ret = 0; +                goto out; +        } +          for (i = 0; i < vol_count; i++) {                  dict = dict_new ();  | 
