From 836c5f0075e83816d00003da440d5c728aefb93e Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Mon, 9 Jan 2012 17:03:21 +0530 Subject: cli: Corrected replace-brick error messages and usage string. Change-Id: I2739529ca572fd762fbbed27de9e433e8c5b1f81 BUG: 772583 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.com/2613 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-parser.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 17f03bb1c4e..fa46fa06671 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1122,6 +1122,7 @@ cli_cmd_volume_replace_brick_parse (const char **words, int wordcount, GF_ASSERT (!"opword mismatch"); /* commit force option */ + op_index = 6; if (wordcount > (op_index + 1)) { @@ -1130,6 +1131,10 @@ cli_cmd_volume_replace_brick_parse (const char **words, int wordcount, } if (wordcount == (op_index + 1)) { + if (replace_op != GF_REPLACE_OP_COMMIT) { + ret = -1; + goto out; + } if (!strcmp ("force", words[op_index])) { replace_op = GF_REPLACE_OP_COMMIT_FORCE; } @@ -1146,13 +1151,11 @@ cli_cmd_volume_replace_brick_parse (const char **words, int wordcount, goto out; - - *options = dict; out: if (ret) { - gf_log ("cli", GF_LOG_ERROR, "Unable to parse remove-brick CLI"); + gf_log ("cli", GF_LOG_ERROR, "Unable to parse replace-brick CLI"); if (dict) dict_destroy (dict); } -- cgit