From 054b09eb5f040ccc0adbb86759da403b49544083 Mon Sep 17 00:00:00 2001 From: Anuradha Talur Date: Wed, 31 Aug 2016 15:27:31 +0530 Subject: event: fix gf_event messages for replace/reset brick op Change-Id: I80ebeeaffd2b228d7d0796c8d08bc2a051c4ccac BUG: 1266876 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/15370 Smoke: Gluster Build System Reviewed-by: Atin Mukherjee CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- cli/src/cli-cmd-volume.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'cli') 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; -- cgit