summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli-cmd-parser.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index fef2c74f971..ac4221ff8c4 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -529,19 +529,23 @@ cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
goto out;
}
if (replica_count == 2) {
- question = "Replica 2 volumes are prone to "
- "split-brain. Use Arbiter or Replica"
- " 3 to avoid this. See: "
- " http://docs.gluster.org/en/latest/Administrator%20Guide/Split%20brain%20and%20ways%20to%20deal%20with%20it/."
- "\nDo you still want to continue?\n";
- answer = cli_cmd_get_confirmation (state,
- question);
- if (GF_ANSWER_NO == answer) {
- gf_log ("cli", GF_LOG_ERROR,
- "Volume create cancelled, "
- "exiting");
- ret = -1;
- goto out;
+ if (strcmp (words[wordcount - 1], "force")) {
+ question = "Replica 2 volumes are prone"
+ " to split-brain. Use "
+ "Arbiter or Replica 3 to "
+ "avoid this. See: "
+ "http://docs.gluster.org/en/latest/Administrator%20Guide/Split%20brain%20and%20ways%20to%20deal%20with%20it/."
+ "\nDo you still want to "
+ "continue?\n";
+ answer = cli_cmd_get_confirmation (state,
+ question);
+ if (GF_ANSWER_NO == answer) {
+ gf_log ("cli", GF_LOG_ERROR,
+ "Volume create "
+ "cancelled, exiting");
+ ret = -1;
+ goto out;
+ }
}
}
ret = dict_set_int32 (dict, "replica-count", replica_count);