summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-06-11 11:38:14 +0530
committerVijay Bellur <vbellur@redhat.com>2012-08-01 23:28:32 -0700
commitd451dfeb4643b1894e99dc66454f630d26c459a1 (patch)
tree820e0f8d307309e5791eb03f0eb10c5ec498edb0
parent1cc71909a619ee9f081ccb0646aeb015fd6f7598 (diff)
cli: Change cli output for heal commands
BUG: 826406 Change-Id: Ic32c89b92314ee201ec67afc4617e412d4b4c21d Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3636 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-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 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) ||