From 37a553575ff8df7ede86e3c69fb48d77bfaccafe Mon Sep 17 00:00:00 2001 From: Manikandan Selvaganesh Date: Mon, 5 Oct 2015 12:59:18 +0530 Subject: tier/cli : throw a warning when user issues a detach-tier commit/force command Backport of http://review.gluster.org/#/c/12297/ > Change-Id: Idf7664d509156ce46ef4308ffc07fb556a0aedd2 > BUG: 1268755 > Signed-off-by: Manikandan Selvaganesh > Reviewed-on: http://review.gluster.org/12297 > Tested-by: NetBSD Build System >Tested-by: Gluster Build System > Reviewed-by: mohammed rafi kc > Reviewed-by: Dan Lambright Change-Id: Idf7664d509156ce46ef4308ffc07fb556a0aedd2 BUG: 1269035 Signed-off-by: Manikandan Selvaganesh Reviewed-on: http://review.gluster.org/12305 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- cli/src/cli-cmd-parser.c | 4 +++- cli/src/cli-cmd-volume.c | 3 ++- cli/src/cli.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index ffe945b0fac..ab18aa1ae6d 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1762,7 +1762,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; @@ -1794,8 +1794,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 4f71e21822a..c23f31b83e3 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1001,7 +1001,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 ccf55761870..59315797eef 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -274,7 +274,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, -- cgit