diff options
author | shishir gowda <shishirng@gluster.com> | 2012-04-02 18:32:05 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-02 11:29:37 -0700 |
commit | 7bcf48a73f6313a0cffbc37288041f1dc8bba71e (patch) | |
tree | 335c795de57be1fb8b20237c085e2e289a9d4444 /cli | |
parent | dcfd0f4ee8c3c405f768cbb79219c0c5fa071a56 (diff) |
cli/rebalance: Fix parse error for volume rebalance cmd
gluster volume rebalance <vol> force was handled as a success.
Signed-off-by: shishir gowda <shishirng@gluster.com>
Change-Id: I4f73aa5935c7e62673d457b52a6dfea6c7197dcc
BUG: 808991
Reviewed-on: http://review.gluster.com/3064
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 6b65d5f85be..c3222547db1 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -736,7 +736,6 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word, dict_t *dict = NULL; int sent = 0; int parse_error = 0; - int index = 0; #ifdef GF_SOLARIS_HOST_OS cli_out ("Command not supported on Solaris"); goto out; @@ -757,7 +756,12 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word, } if (wordcount == 4) { - index = 3; + if (strcmp (words[3], "start") && strcmp (words[3], "stop") && + strcmp (words[3], "status")) { + cli_usage_out (word->pattern); + parse_error = 1; + goto out; + } } else { if (strcmp (words[3], "fix-layout") && strcmp (words[3], "start")) { @@ -765,16 +769,8 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word, parse_error = 1; goto out; } - index = 4; } - if (strcmp (words[index], "start") && strcmp (words[index], "stop") && - strcmp (words[index], "status") && strcmp (words[index], "force")) { - cli_usage_out (word->pattern); - parse_error = 1; - goto out; - } - ret = dict_set_str (dict, "volname", (char *)words[2]); if (ret) goto out; |