diff options
author | Aravinda VK <avishwan@redhat.com> | 2016-09-05 11:15:10 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-09-06 22:18:58 -0700 |
commit | f20e41aec392a45f860fa7e80ad5ee9d5607a45c (patch) | |
tree | 81019e33427bfb6397a19ee62cc3aabd9ff77b8b /cli/src/cli-cmd-volume.c | |
parent | dd4fae6c78dc70cd31fe82ecd8aa85ade93cf17f (diff) |
eventsapi: Fix Volume Stop and delete prompt issue
During Volume Stop and Delete, event is emitted even if
prompt answer is No.
Also added "force" details in START and STOP events.
BUG: 1373072
Change-Id: I986dcff7154b584f6ed44b533d4eeabe82815235
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/15399
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index eb3b2c50fa3..003c95395ef 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -317,7 +317,7 @@ out: CLI_STACK_DESTROY (frame); - if (ret == 0) { + if (ret == 0 && GF_ANSWER_YES == answer) { gf_event (EVENT_VOLUME_DELETE, "name=%s", (char *)words[2]); } @@ -396,7 +396,8 @@ out: CLI_STACK_DESTROY (frame); if (ret == 0) { - gf_event (EVENT_VOLUME_START, "name=%s", (char *)words[2]); + gf_event (EVENT_VOLUME_START, "name=%s;force=%d", + (char *)words[2], (flags & GF_CLI_FLAG_OP_FORCE)); } return ret; @@ -531,8 +532,9 @@ out: CLI_STACK_DESTROY (frame); - if (ret == 0) { - gf_event (EVENT_VOLUME_STOP, "name=%s", (char *)words[2]); + if (ret == 0 && GF_ANSWER_YES == answer) { + gf_event (EVENT_VOLUME_STOP, "name=%s;force=%d", + (char *)words[2], (flags & GF_CLI_FLAG_OP_FORCE)); } return ret; |