summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorAnuradha Talur <atalur@redhat.com>2016-08-31 15:27:31 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-08-31 15:56:31 -0700
commit054b09eb5f040ccc0adbb86759da403b49544083 (patch)
treeae942c73fec67d77c8fd5e14353a83f38d4bdc2c /cli/src/cli-cmd-volume.c
parent63d24908e01b24cc21bea584fed4b719fca865f3 (diff)
event: fix gf_event messages for replace/reset brick op
Change-Id: I80ebeeaffd2b228d7d0796c8d08bc2a051c4ccac BUG: 1266876 Signed-off-by: Anuradha Talur <atalur@redhat.com> Reviewed-on: http://review.gluster.org/15370 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 2171d357aa5..eb3b2c50fa3 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1837,10 +1837,10 @@ cli_cmd_volume_reset_brick_cbk (struct cli_state *state,
int ret = -1;
rpc_clnt_procedure_t *proc = NULL;
call_frame_t *frame = NULL;
- dict_t *options = NULL;
- int sent = 0;
- int parse_error = 0;
- cli_local_t *local = NULL;
+ dict_t *options = NULL;
+ int sent = 0;
+ int parse_error = 0;
+ cli_local_t *local = NULL;
#ifdef GF_SOLARIS_HOST_OS
cli_out ("Command not supported on Solaris");
@@ -1868,14 +1868,22 @@ cli_cmd_volume_reset_brick_cbk (struct cli_state *state,
out:
if (ret) {
- gf_event (EVENT_BRICK_RESET, "Volume reset-brick failed.");
cli_cmd_sent_status_get (&sent);
if ((sent == 0) && (parse_error == 0))
cli_out ("Volume reset-brick failed");
} else {
- gf_event (EVENT_BRICK_RESET, "Volume reset-brick succeeded.");
+ if (wordcount > 5) {
+ gf_event (EVENT_BRICK_RESET_COMMIT,
+ "Volume=%s;source-brick=%s;"
+ "destination-brick=%s",
+ (char *)words[2], (char *)words[3],
+ (char *)words[4]);
+ } else {
+ gf_event (EVENT_BRICK_RESET_START,
+ "Volume=%s;source-brick=%s",
+ (char *)words[2], (char *)words[3]);
+ }
}
-
CLI_STACK_DESTROY (frame);
return ret;
@@ -1921,14 +1929,14 @@ cli_cmd_volume_replace_brick_cbk (struct cli_state *state,
out:
if (ret) {
- gf_event (EVENT_BRICK_REPLACE, "Volume replace-brick failed.");
cli_cmd_sent_status_get (&sent);
if ((sent == 0) && (parse_error == 0))
cli_out ("Volume replace-brick failed");
} else {
- gf_event (EVENT_BRICK_RESET, "Volume replace-brick succeeded.");
+ gf_event (EVENT_BRICK_REPLACE,
+ "Volume=%s;source-brick=%s;destination-brick=%s",
+ (char *)words[2], (char *)words[3], (char *)words[4]);
}
-
CLI_STACK_DESTROY (frame);
return ret;