diff options
author | Aravinda VK <avishwan@redhat.com> | 2016-09-05 11:15:10 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2016-09-08 23:58:39 -0700 |
commit | 0587f334e2e4fd71ad61f65db10ffe1b1ad5d1f9 (patch) | |
tree | 106a63316a4c17b52d23aa4a8660e2404053b986 /cli | |
parent | 40135e9811efe2fb4cbdff302d5a2c461e4147d4 (diff) |
cli/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.
> 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>
BUG: 1373735
Change-Id: I986dcff7154b584f6ed44b533d4eeabe82815235
Signed-off-by: Aravinda VK <avishwan@redhat.com>
(cherry picked from commit f20e41aec392a45f860fa7e80ad5ee9d5607a45c)
Change-Id: Iee1a2a2f3749cfcf8dd0dcd3fcc3b48372fa06b1
Reviewed-on: http://review.gluster.org/15414
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli')
-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 e87669cd75d..6d0fdf765b4 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; |