diff options
| author | Amar Tumballi <amar@gluster.com> | 2011-03-30 23:48:25 +0000 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2011-04-06 12:06:01 -0700 | 
| commit | b149dd5665f80ef1505536faab08c8e9163c691e (patch) | |
| tree | c52cef41e42fdd096a944028168c4e5d324640ea | |
| parent | 626247d559f14267762b32cde71d10d69a161601 (diff) | |
cli: fix gluster rebalance command with fix-layout and migrate-data
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@gluster.com>
BUG: 2547 (rebalance command usage and help mis-match)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2547
| -rw-r--r-- | cli/src/cli-cmd-volume.c | 17 | 
1 files changed, 15 insertions, 2 deletions
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;  | 
