summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorManikandan Selvaganesh <mselvaga@redhat.com>2015-10-05 12:59:18 +0530
committerDan Lambright <dlambrig@redhat.com>2015-10-05 06:15:51 -0700
commitc62dcfff26082b4c2d23e89f905bd85f865211db (patch)
treece84be0fff3c8c1d4f7635af6d9491e6fa1a7c8b /cli
parente94e1f2b8ae2328da10161f6421ea5c9b1d7277e (diff)
tier/cli : throw a warning when user issues a detach-tier commit/force
command Change-Id: Idf7664d509156ce46ef4308ffc07fb556a0aedd2 BUG: 1268755 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/12297 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c4
-rw-r--r--cli/src/cli-cmd-volume.c3
-rw-r--r--cli/src/cli.h2
3 files changed, 6 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 2ca7707d722..46bcce3cbe7 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1757,7 +1757,7 @@ out:
int32_t
cli_cmd_volume_detach_tier_parse (const char **words, int wordcount,
- dict_t **options)
+ dict_t **options, int *question)
{
int ret = -1;
char *word = NULL;
@@ -1789,8 +1789,10 @@ cli_cmd_volume_detach_tier_parse (const char **words, int wordcount,
if (!strcmp(word, "start")) {
command = GF_OP_CMD_DETACH_START;
} else if (!strcmp(word, "commit")) {
+ *question = 1;
command = GF_OP_CMD_DETACH_COMMIT;
} else if (!strcmp(word, "force")) {
+ *question = 1;
command = GF_OP_CMD_DETACH_COMMIT_FORCE;
} else if (!strcmp(word, "stop"))
command = GF_OP_CMD_STOP_DETACH_TIER;
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 7a350a9dc76..b6a6628aa92 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -996,7 +996,8 @@ do_cli_cmd_volume_detach_tier (struct cli_state *state,
if (!frame)
goto out;
- ret = cli_cmd_volume_detach_tier_parse(words, wordcount, &options);
+ ret = cli_cmd_volume_detach_tier_parse(words, wordcount, &options,
+ &need_question);
if (ret) {
cli_usage_out (word->pattern);
parse_error = 1;
diff --git a/cli/src/cli.h b/cli/src/cli.h
index e987c4450c3..9ba95c4a2d5 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -269,7 +269,7 @@ cli_cmd_volume_add_brick_parse (const char **words, int wordcount,
int32_t
cli_cmd_volume_detach_tier_parse (const char **words, int wordcount,
- dict_t **options);
+ dict_t **options, int *question);
int32_t
cli_cmd_volume_tier_parse (const char **words, int wordcount,