|
|
3604df |
From e522517af3b4a1c449a8e74386f8c41d16e4cf16 Mon Sep 17 00:00:00 2001
|
|
|
3604df |
From: Aravinda VK <avishwan@redhat.com>
|
|
|
3604df |
Date: Mon, 5 Sep 2016 11:15:10 +0530
|
|
|
3604df |
Subject: [PATCH 42/86] eventsapi: Fix Volume Stop and delete prompt issue
|
|
|
3604df |
|
|
|
3604df |
During Volume Stop and Delete, event is emitted even if
|
|
|
3604df |
prompt answer is No.
|
|
|
3604df |
|
|
|
3604df |
Also added "force" details in START and STOP events.
|
|
|
3604df |
|
|
|
3604df |
> Reviewed-on: http://review.gluster.org/15399
|
|
|
3604df |
> Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
3604df |
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
3604df |
> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
|
|
|
3604df |
BUG: 1351589
|
|
|
3604df |
Change-Id: I986dcff7154b584f6ed44b533d4eeabe82815235
|
|
|
3604df |
Signed-off-by: Aravinda VK <avishwan@redhat.com>
|
|
|
3604df |
Reviewed-on: https://code.engineering.redhat.com/gerrit/84746
|
|
|
3604df |
Reviewed-by: Milind Changire <mchangir@redhat.com>
|
|
|
3604df |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
3604df |
---
|
|
|
3604df |
cli/src/cli-cmd-volume.c | 10 ++++++----
|
|
|
3604df |
1 files changed, 6 insertions(+), 4 deletions(-)
|
|
|
3604df |
|
|
|
3604df |
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
|
|
|
3604df |
index 09cfcee..3a7c9ed 100644
|
|
|
3604df |
--- a/cli/src/cli-cmd-volume.c
|
|
|
3604df |
+++ b/cli/src/cli-cmd-volume.c
|
|
|
3604df |
@@ -321,7 +321,7 @@ out:
|
|
|
3604df |
|
|
|
3604df |
CLI_STACK_DESTROY (frame);
|
|
|
3604df |
|
|
|
3604df |
- if (ret == 0) {
|
|
|
3604df |
+ if (ret == 0 && GF_ANSWER_YES == answer) {
|
|
|
3604df |
gf_event (EVENT_VOLUME_DELETE, "name=%s", (char *)words[2]);
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
@@ -400,7 +400,8 @@ out:
|
|
|
3604df |
CLI_STACK_DESTROY (frame);
|
|
|
3604df |
|
|
|
3604df |
if (ret == 0) {
|
|
|
3604df |
- gf_event (EVENT_VOLUME_START, "name=%s", (char *)words[2]);
|
|
|
3604df |
+ gf_event (EVENT_VOLUME_START, "name=%s;force=%d",
|
|
|
3604df |
+ (char *)words[2], (flags & GF_CLI_FLAG_OP_FORCE));
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
return ret;
|
|
|
3604df |
@@ -535,8 +536,9 @@ out:
|
|
|
3604df |
|
|
|
3604df |
CLI_STACK_DESTROY (frame);
|
|
|
3604df |
|
|
|
3604df |
- if (ret == 0) {
|
|
|
3604df |
- gf_event (EVENT_VOLUME_STOP, "name=%s", (char *)words[2]);
|
|
|
3604df |
+ if (ret == 0 && GF_ANSWER_YES == answer) {
|
|
|
3604df |
+ gf_event (EVENT_VOLUME_STOP, "name=%s;force=%d",
|
|
|
3604df |
+ (char *)words[2], (flags & GF_CLI_FLAG_OP_FORCE));
|
|
|
3604df |
}
|
|
|
3604df |
|
|
|
3604df |
return ret;
|
|
|
3604df |
--
|
|
|
3604df |
1.7.1
|
|
|
3604df |
|