diff options
| -rw-r--r-- | cli/src/cli-cmd-parser.c | 38 | 
1 files changed, 21 insertions, 17 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index e9c8dfa352c..8f61e9634e7 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -533,24 +533,28 @@ cli_cmd_volume_create_parse (struct cli_state *state, const char **words,                                  goto out;                          index += 2; -                        if (!strcmp (words[index], "arbiter")) { -                                ret = gf_string2int (words[index+1], -                                                     &arbiter_count); -                                if (ret == -1 || arbiter_count != 1 || -                                    replica_count != 3) { -                                        cli_err ("For arbiter configuration, " -                                                 "replica count must be 3 and " -                                                 "arbiter count must be 1. " -                                                 "The 3rd brick of the replica " -                                                 "will be the arbiter."); -                                        ret = -1; -                                        goto out; +                        if (words[index]) { +                                if (!strcmp (words[index], "arbiter")) { +                                        ret = gf_string2int (words[index+1], +                                                             &arbiter_count); +                                        if (ret == -1 || arbiter_count != 1 || +                                            replica_count != 3) { +                                                cli_err ("For arbiter " +                                                         "configuration, " +                                                         "replica count must be" +                                                         " 3 and arbiter count " +                                                         "must be 1. The 3rd " +                                                         "brick of the replica " +                                                         "will be the arbiter"); +                                                ret = -1; +                                                goto out; +                                        } +                                        ret = dict_set_int32 (dict, "arbiter-count", +                                                              arbiter_count); +                                        if (ret) +                                                goto out; +                                        index += 2;                                  } -                                ret = dict_set_int32 (dict, "arbiter-count", -                                                      arbiter_count); -                                if (ret) -                                        goto out; -                                index += 2;                          }                  } else if ((strcmp (w, "stripe")) == 0) {  | 
