From 59dde88921ba506800c55f583c679630f85290e1 Mon Sep 17 00:00:00 2001 From: Venkatesh Somyajulu Date: Thu, 4 Jul 2013 16:07:59 +0530 Subject: cli: gluster volume heal commands are more elaborative 1. "gluster volume heal volume-name" output :Launching heal operation to perform index self heal on volume volume-name has been successful 2. "gluster volume heal volume-name full" Output :Launching heal operation to perform full self heal on volume volume-name has been successful 3. "gluster volume heal volume-name info" Output :Gathering list of entries to be healed on volume volume-name has been successful 4. "gluster volume heal volume-name info healed" Output :Gathering list of healed entries on volume volume-name has been successful 5. "gluster volume heal volume-name info split-brain" Output :Gathering list of split brain entries on volume volume-name has been successful 6. "gluster volume heal volume-name info heal-failed" Output :Gathering list of heal failed entries on volume volume-name has been successful Change-Id: I74c90e8129d23d513ddb7879358a9d21c94a5c0d BUG: 978936 Signed-off-by: Venkatesh Somyajulu Reviewed-on: http://review.gluster.org/5286 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index ff0e83cb..fd58bf81 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -6290,6 +6290,7 @@ gf_cli_heal_volume_cbk (struct rpc_req *req, struct iovec *iov, gf_xl_afr_op_t heal_op = GF_AFR_OP_INVALID; char *operation = NULL; char *substr = NULL; + char *heal_op_str = NULL; if (-1 == req->rpc_status) { goto out; @@ -6332,12 +6333,36 @@ gf_cli_heal_volume_cbk (struct rpc_req *req, struct iovec *iov, gf_log ("cli", GF_LOG_INFO, "Received resp to heal volume"); + switch (heal_op) { + case GF_AFR_OP_HEAL_INDEX: + heal_op_str = "to perform index self heal"; + break; + case GF_AFR_OP_HEAL_FULL: + heal_op_str = "to perform full self heal"; + break; + case GF_AFR_OP_INDEX_SUMMARY: + heal_op_str = "list of entries to be healed"; + break; + case GF_AFR_OP_HEALED_FILES: + heal_op_str = "list of healed entries"; + break; + case GF_AFR_OP_HEAL_FAILED_FILES: + heal_op_str = "list of heal failed entries"; + break; + case GF_AFR_OP_SPLIT_BRAIN_FILES: + heal_op_str = "list of split brain entries"; + break; + case GF_AFR_OP_INVALID: + heal_op_str = "invalid heal op"; + break; + } + 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"; + operation = "Gathering"; substr = ""; } @@ -6345,15 +6370,15 @@ gf_cli_heal_volume_cbk (struct rpc_req *req, struct iovec *iov, if (strcmp (rsp.op_errstr, "")) { cli_err ("%s", rsp.op_errstr); } else { - cli_err ("%s on volume %s has been unsuccessful", - operation, volname); + cli_err ("%s %s on volume %s has been unsuccessful", + operation, heal_op_str, volname); } ret = rsp.op_ret; goto out; } else { - cli_out ("%s on volume %s has been successful%s", operation, - volname, substr); + cli_out ("%s %s on volume %s has been successful %s", operation, + heal_op_str, volname, substr); } ret = rsp.op_ret; -- cgit