diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2011-07-15 01:20:08 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-17 07:46:18 -0700 |
commit | 3c6138dbf2ed6ebba6b8108be8f4999ff8226964 (patch) | |
tree | b0d4f0f18b2cee10785cd823fe2b387a0cdb3a4d /cli/src/cli-rpc-ops.c | |
parent | f1b0e963976208cc93e69fc627a81a6f4ab1640b (diff) |
mgmt/Glusterd: Implementation volume set help/help-xml
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2041 (volume set help option)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2041
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 1082a908fb0..ce154f58d6c 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -956,6 +956,8 @@ gf_cli3_1_set_volume_cbk (struct rpc_req *req, struct iovec *iov, { gf1_cli_set_vol_rsp rsp = {0,}; int ret = 0; + dict_t *dict = NULL; + char *help_str = NULL; if (-1 == req->rpc_status) { goto out; @@ -971,9 +973,24 @@ gf_cli3_1_set_volume_cbk (struct rpc_req *req, struct iovec *iov, if (rsp.op_ret && strcmp (rsp.op_errstr, "")) cli_out ("%s", rsp.op_errstr); - else + + dict = dict_new (); + + if (!dict) { + ret = -1; + goto out; + } + + ret = dict_unserialize (rsp.dict.dict_val, rsp.dict.dict_len, &dict); + + if (ret) + goto out; + + if (dict_get_str (dict, "help-str", &help_str)) cli_out ("Set volume %s", (rsp.op_ret) ? "unsuccessful": "successful"); + else + cli_out ("%s", help_str); ret = rsp.op_ret; |