summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-12-22 18:32:11 +0530
committerVijay Bellur <vbellur@redhat.com>2013-12-22 19:07:06 -0800
commit1cc90698094f9483ee8b9731aef96e1a777a7887 (patch)
treedbd6e6682b025d9babd895d084a600ac0ddb120f /cli/src
parent6e1449e5201591bbfcd0effa94f221317ad46a7a (diff)
cli: Throw a warning during replace-brick
Change-Id: Ia024d055645ac2ec5cd506f2533831a159b38c20 BUG: 1039954 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/6559 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-volume.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index c3ef4207163..a7e72dabdf8 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1554,6 +1554,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");
@@ -1573,6 +1578,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_WIGNORE) {
ret = dict_set_int32 (options, "force", _gf_true);
if (ret) {