From 8efbc829490420ebe75b42a1e0f268b950aaba91 Mon Sep 17 00:00:00 2001 From: Rajesh Date: Fri, 29 Jul 2011 13:18:20 +0530 Subject: cli: Improve message in gluster top Removed "volume top successful" message. If top fails,"volume top unsuccessful" is displayed. If errstr is set, it is displayed. "No entries in list" messages deleted. Change-Id: I8ed35ea7db365b7af6b10833672fcab0e4e8751d BUG: 2722 Reviewed-on: http://review.gluster.com/121 Tested-by: Gluster Build System Reviewed-by: Shishir Gowda --- cli/src/cli-rpc-ops.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 50a2631a291..1782b9bac8f 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -2622,11 +2622,9 @@ gf_cli3_1_fsm_log_cbk (struct rpc_req *req, struct iovec *iov, } if (rsp.op_ret) { - if (strcmp (rsp.op_errstr, "")) { + if (strcmp (rsp.op_errstr, "")) cli_out ("%s", rsp.op_errstr); - } else if (rsp.op_ret) { - cli_out ("fsm log unsuccessful"); - } + cli_out ("fsm log unsuccessful"); ret = rsp.op_ret; goto out; } @@ -3311,14 +3309,10 @@ gf_cli3_1_top_volume_cbk (struct rpc_req *req, struct iovec *iov, goto out; } - if (rsp.op_ret && strcmp (rsp.op_errstr, "")) { - cli_out ("%s", rsp.op_errstr); - } else { - cli_out ("volume top %s ", - (rsp.op_ret) ? "unsuccessful": "successful"); - } - if (rsp.op_ret) { + if (strcmp (rsp.op_errstr, "")) + cli_out ("%s", rsp.op_errstr); + cli_out ("volume top unsuccessful"); ret = rsp.op_ret; goto out; } @@ -3385,7 +3379,6 @@ gf_cli3_1_top_volume_cbk (struct rpc_req *req, struct iovec *iov, case GF_CLI_TOP_OPENDIR: case GF_CLI_TOP_READDIR: if (!members) { - cli_out ("No entries in list"); continue; } cli_out ("Count\t\tfilename\n======================="); @@ -3403,7 +3396,6 @@ gf_cli3_1_top_volume_cbk (struct rpc_req *req, struct iovec *iov, time / 1e6); if (!members) { - cli_out ("No entries in list"); continue; } cli_out ("MBps\t\tfilename\t\t time\n========================"); -- cgit