From b149dd5665f80ef1505536faab08c8e9163c691e Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 30 Mar 2011 23:48:25 +0000 Subject: cli: fix gluster rebalance command with fix-layout and migrate-data Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 2547 (rebalance command usage and help mis-match) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2547 --- cli/src/cli-cmd-volume.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-cmd-volume.c') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 8414a50b69c..ef9da890168 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -463,6 +463,7 @@ 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; @@ -482,8 +483,20 @@ cli_cmd_volume_defrag_cbk (struct cli_state *state, struct cli_cmd_word *word, goto out; } - if (strcmp (words[3], "start") && strcmp (words[3], "stop") && - strcmp (words[3], "status")) { + if (wordcount == 4) { + index = 3; + } else { + if (strcmp (words[3], "fix-layout") && + strcmp (words[3], "migrate-data")) { + cli_usage_out (word->pattern); + parse_error = 1; + goto out; + } + index = 4; + } + + if (strcmp (words[index], "start") && strcmp (words[index], "stop") && + strcmp (words[index], "status")) { cli_usage_out (word->pattern); parse_error = 1; goto out; -- cgit