summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-10-04 12:15:34 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-04 11:37:38 -0700
commitdc1113c4a02b1b1186bf37e09685631891d85537 (patch)
tree8d992bb7ed8283b02d7648fc765a0c86426460f8 /cli/src
parent841ee8d5021980d836c834792b581475b05b0e6b (diff)
cli: mgmt/glusterd: Add commit force op to replace-brick
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1235 (Bug for all pump/migrate commits) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1235
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-parser.c21
-rw-r--r--cli/src/cli3_1-cops.c1
2 files changed, 20 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index a6f9cf915a1..d01e4f71196 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -822,8 +822,7 @@ cli_cmd_volume_replace_brick_parse (const char **words, int wordcount,
goto out;
op_index = 5;
- if ((wordcount < (op_index + 1)) ||
- (wordcount > (op_index + 1))) {
+ if ((wordcount < (op_index + 1))) {
ret = -1;
goto out;
}
@@ -842,6 +841,21 @@ cli_cmd_volume_replace_brick_parse (const char **words, int wordcount,
replace_op = GF_REPLACE_OP_STATUS;
}
+ /* commit force option */
+ op_index = 6;
+
+ if (wordcount > (op_index + 1)) {
+ ret = -1;
+ goto out;
+ }
+
+ if (wordcount == (op_index + 1)) {
+ op = (char *) words[op_index];
+ if (!strcasecmp ("force", op)) {
+ replace_op = GF_REPLACE_OP_COMMIT_FORCE;
+ }
+ }
+
if (replace_op == GF_REPLACE_OP_NONE) {
ret = -1;
goto out;
@@ -852,6 +866,9 @@ cli_cmd_volume_replace_brick_parse (const char **words, int wordcount,
if (ret)
goto out;
+
+
+
*options = dict;
out:
diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c
index 2933edffb01..a4a3304cd58 100644
--- a/cli/src/cli3_1-cops.c
+++ b/cli/src/cli3_1-cops.c
@@ -1007,6 +1007,7 @@ gf_cli3_1_replace_brick_cbk (struct rpc_req *req, struct iovec *iov,
break;
case GF_REPLACE_OP_COMMIT:
+ case GF_REPLACE_OP_COMMIT_FORCE:
ret = dict_get_str (dict, "src-brick", &src_brick);
if (ret) {
gf_log ("", GF_LOG_DEBUG,