From 50001216d26a16736691ab06758049c22e664936 Mon Sep 17 00:00:00 2001 From: Junaid Date: Wed, 15 Jun 2011 02:41:36 +0000 Subject: cli: Print the error message sent by glusterd when quota list cmd fails. Signed-off-by: Junaid Signed-off-by: Anand Avati BUG: 2856 ([glusterfs-3.2]: Misleading 'quota remove' output.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2856 --- cli/src/cli-rpc-ops.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 8fc73032a33..cea1129097d 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) -- cgit