From d6f687084d94a17abf505b8d0bf315d18bf937ee Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 23 Dec 2013 11:56:03 +0530 Subject: cli: Throw a warning during replace-brick Change-Id: Iae59365f09bf64a5927edeeb4c3c052e237eee38 BUG: 1039954 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/6560 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-volume.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cli/src') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index e693f118277..528cd5e824b 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1150,6 +1150,11 @@ cli_cmd_volume_replace_brick_cbk (struct cli_state *state, int sent = 0; int parse_error = 0; cli_local_t *local = NULL; + int replace_op = 0; + char *q = "All replace-brick commands except " + "commit force are deprecated. " + "Do you want to continue?"; + gf_answer_t answer = GF_ANSWER_NO; #ifdef GF_SOLARIS_HOST_OS cli_out ("Command not supported on Solaris"); @@ -1169,6 +1174,15 @@ cli_cmd_volume_replace_brick_cbk (struct cli_state *state, goto out; } + ret = dict_get_int32 (options, "operation", &replace_op); + if (replace_op != GF_REPLACE_OP_COMMIT_FORCE) { + answer = cli_cmd_get_confirmation (state, q); + if (GF_ANSWER_NO == answer) { + ret = 0; + goto out; + } + } + if (state->mode & GLUSTER_MODE_SCRIPT) { ret = dict_set_int32 (options, "force", _gf_true); if (ret) { -- cgit