summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2012-01-09 17:03:21 +0530
committergluster-ant <bugzilla-bot@gluster.org>2012-01-09 17:03:21 +0530
commit9727cdbf41cdf910ed09691150b97dc008a28239 (patch)
tree09c8d8b5e55f33dd0ac523289cb61ea1543fae01 /cli/src
parentc1ef6b38bda2d0704008bd57bbcda214003583d0 (diff)
cli: Corrected replace-brick error messages and usage string.
Change-Id: I2739529ca572fd762fbbed27de9e433e8c5b1f81 BUG: 772583 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/2613 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-parser.c9
-rw-r--r--cli/src/cli-cmd-volume.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 17f03bb1c4..fa46fa0667 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);
}
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 2336dfe443..009896d9ce 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1548,7 +1548,7 @@ struct cli_cmd volume_cmds[] = {
cli_cmd_volume_defrag_cbk,
"rebalance operations"},
- { "volume replace-brick <VOLNAME> <BRICK> <NEW-BRICK> {start|pause|abort|status|commit}",
+ { "volume replace-brick <VOLNAME> <BRICK> <NEW-BRICK> {start|pause|abort|status|commit [force]}",
cli_cmd_volume_replace_brick_cbk,
"replace-brick operations"},