From 68e8d617eb62a7ec40a1db5f3f60730767a168b6 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Thu, 10 Sep 2015 16:07:29 +0530 Subject: Tier/cli: Change detach-tier commit force to detach-tier force Current detach-tier cli command support commit force. Deprecating the same to force. So the new syntax would be: volume detach-tier Change-Id: Ie86dfd72341078c0a1be94767f523730911312ef BUG: 1261862 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/12151 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- cli/src/cli-cmd-parser.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 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 bd931ded3e0..2ca7707d722 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1777,21 +1777,11 @@ cli_cmd_volume_detach_tier_parse (const char **words, int wordcount, return -1; } - if (!((wordcount == 4) || (wordcount == 5))) { + if (wordcount != 4) { ret = -1; goto out; } - if (wordcount == 5) { - word = (char *)words[4]; - if (!strcmp(word, "force")) - force = 1; - else { - ret = -1; - goto out; - } - } - word = (char *)words[3]; ret = -1; @@ -1799,10 +1789,9 @@ cli_cmd_volume_detach_tier_parse (const char **words, int wordcount, if (!strcmp(word, "start")) { command = GF_OP_CMD_DETACH_START; } else if (!strcmp(word, "commit")) { - if (force) - command = GF_OP_CMD_DETACH_COMMIT_FORCE; - else - command = GF_OP_CMD_DETACH_COMMIT; + command = GF_OP_CMD_DETACH_COMMIT; + } else if (!strcmp(word, "force")) { + command = GF_OP_CMD_DETACH_COMMIT_FORCE; } else if (!strcmp(word, "stop")) command = GF_OP_CMD_STOP_DETACH_TIER; else if (!strcmp(word, "status")) -- cgit