summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-06-11 11:38:14 +0530
committerAnand Avati <avati@redhat.com>2012-06-13 15:38:00 -0700
commitd191f745bbec5f53e19c33702e5749fa8fba9aee (patch)
tree994cf4ca790eaae3aefe20194dafcaa0383eb1a5 /cli
parentc053ef8a5657426fff8f807a066e4b1bb76bd881 (diff)
cli: Change cli output for heal commands
Change-Id: I05011ba7c1fe79867e151672622e9d8669884dd2 BUG: 826406 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3544 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 313484cf4f9..952117413c6 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -5924,6 +5924,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;
@@ -5967,11 +5969,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) ||