diff options
author | Junaid <junaid@gluster.com> | 2011-06-15 02:41:36 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-06-17 08:33:56 -0700 |
commit | 50001216d26a16736691ab06758049c22e664936 (patch) | |
tree | f028ee07af0e574a2f4a457853bd21cb86b4fa48 /cli | |
parent | 4e1ec35ef4f7bbf70c3e08e7c246946551f19e93 (diff) |
cli: Print the error message sent by glusterd when quota list cmd fails.
Signed-off-by: Junaid <junaid@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2856 ([glusterfs-3.2]: Misleading 'quota remove' output.)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2856
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 8fc73032a..cea112909 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -1312,7 +1312,8 @@ out: } int32_t -gf_cli3_1_print_limit_list (char *volname, char *limit_list) +gf_cli3_1_print_limit_list (char *volname, char *limit_list, + char *op_errstr) { int64_t size = 0; int64_t limit_value = 0; @@ -1332,6 +1333,12 @@ gf_cli3_1_print_limit_list (char *volname, char *limit_list) if (!connected) goto out; + len = strlen (limit_list); + if (len == 0) { + cli_out ("%s", op_errstr?op_errstr:"quota limit not set "); + goto out; + } + if (mkdtemp (mountdir) == NULL) { gf_log ("cli", GF_LOG_WARNING, "failed to create a temporary " "mount directory"); @@ -1441,9 +1448,11 @@ gf_cli3_1_quota_cbk (struct rpc_req *req, struct iovec *iov, } if (rsp.type == GF_QUOTA_OPTION_TYPE_LIST) { - if (rsp.limit_list) + if (rsp.limit_list) { gf_cli3_1_print_limit_list (rsp.volname, - rsp.limit_list); + rsp.limit_list, + rsp.op_errstr); + } } else { gf_log ("cli", GF_LOG_INFO, "Received resp to quota command "); if (rsp.op_errstr) |