summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorVishal Pandey <vpandey@redhat.com>2019-09-23 20:12:21 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-10-14 09:38:17 +0000
commitc2279f50178be4408a72c04fbbfd6ccc70c50996 (patch)
tree15a0b2caa64f107c6bd05d5185f9f8f4c0e855b3 /cli
parentcdf34880e6788a396c8f02ba7e0263ea09d3676a (diff)
cli: raise error in cli when replica != 2 while ta vol creation
When creating a thin-arbiter volume, if the replica-count provided is other than 2, the cli command fails(which is the expected behaviour) but it fails while transaction is being committed on localhost. This, ideally should be handled in cli itself. Change-Id: I52ecdaf49a7df85670505e4743cdcf3101c71c9f Signed-off-by: Vishal Pandey <vpandey@redhat.com> Fixes: bz#1754477
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 8379a2cb4c1..a0e68ffa420 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -675,7 +675,8 @@ cli_cmd_volume_create_parse(struct cli_state *state, const char **words,
index += 2;
} else if (!strcmp(words[index], "thin-arbiter")) {
ret = gf_string2int(words[index + 1], &thin_arbiter_count);
- if ((ret == -1) || (thin_arbiter_count != 1)) {
+ if ((ret == -1) || (thin_arbiter_count != 1) ||
+ (replica_count != 2)) {
cli_err(
"For thin-arbiter "
"configuration, "