From d451dfeb4643b1894e99dc66454f630d26c459a1 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 11 Jun 2012 11:38:14 +0530 Subject: cli: Change cli output for heal commands BUG: 826406 Change-Id: Ic32c89b92314ee201ec67afc4617e412d4b4c21d Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3636 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'cli/src') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index dad863cd8..b85cec1c9 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -5867,6 +5867,8 @@ gf_cli3_1_heal_volume_cbk (struct rpc_req *req, struct iovec *iov, int brick_count = 0; int i = 0; gf_xl_afr_op_t heal_op = GF_AFR_OP_INVALID; + char *operation = NULL; + char *substr = NULL; if (-1 == req->rpc_status) { goto out; @@ -5910,11 +5912,26 @@ gf_cli3_1_heal_volume_cbk (struct rpc_req *req, struct iovec *iov, gf_log ("cli", GF_LOG_INFO, "Received resp to heal volume"); - if (rsp.op_ret && strcmp (rsp.op_errstr, "")) - cli_err ("%s", rsp.op_errstr); - else - cli_out ("Heal operation on volume %s has been %s", volname, - (rsp.op_ret) ? "unsuccessful": "successful"); + if ((heal_op == GF_AFR_OP_HEAL_FULL) || + (heal_op == GF_AFR_OP_HEAL_INDEX)) { + operation = "Launching Heal operation"; + substr = "\nUse heal info commands to check status"; + } else { + operation = "Gathering Heal info"; + substr = ""; + } + + if (rsp.op_ret) { + if (strcmp (rsp.op_errstr, "")) { + cli_err ("%s", rsp.op_errstr); + } else { + cli_err ("%s on volume %s has been unsuccessful", + operation, volname); + } + } else { + cli_out ("%s on volume %s has been successful%s", operation, + volname, substr); + } ret = rsp.op_ret; if ((heal_op == GF_AFR_OP_HEAL_FULL) || -- cgit