From 11e28d3aedabac01b5cfc219745681426b5cf416 Mon Sep 17 00:00:00 2001 From: "Ravishankar N ravishankar@redhat.com" Date: Wed, 6 Nov 2013 18:40:25 +0530 Subject: glusterd: modify remove-brick CLI message. In the current context "replica_cnt" is used just to know whether the specific key exists or not by calling "dict_get_int32", which we can replace by "dict_get ()". And changing the log message as it is more appropriate to say "migration of data" rather than "rebalance". This patch refactors commit 51c6fa7a354826744de98 against BZ 961669 reviewed on : http://review.gluster.org/5566 Change-Id: I48eae206a28d4083975e64407ed8fe4539f9c24b BUG: 1027270 Signed-off-by: Ravishankar N Original patch: Susant Palai Reviewed-on: http://review.gluster.org/6001 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Reviewed-by: susant palai Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-volume.c | 2 +- xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index f8988f1d7..4b4bd02d2 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -1856,7 +1856,7 @@ struct cli_cmd volume_cmds[] = { cli_cmd_volume_add_brick_cbk, "add brick to volume "}, - { "volume remove-brick [replica ] ... {start|stop|status|commit|force}", + { "volume remove-brick [replica ] ... [start|stop|status|commit|force]", cli_cmd_volume_remove_brick_cbk, "remove brick from volume "}, diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index e5b7eb566..5b9471fa7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1364,7 +1364,6 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) glusterd_volinfo_t *volinfo = NULL; char *errstr = NULL; int32_t brick_count = 0; - int32_t replica_cnt = 0; char msg[2048] = {0,}; int32_t flag = 0; gf1_op_commands cmd = GF_OP_CMD_NONE; @@ -1421,10 +1420,10 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) case GF_OP_CMD_START: { if ((volinfo->type == GF_CLUSTER_TYPE_REPLICATE) && - !dict_get_int32 (dict, "replica-count", &replica_cnt)) { - snprintf (msg, sizeof(msg), "Rebalancing not needed " - "when reducing replica count. Try without " - "the 'start' option"); + dict_get (dict, "replica-count")) { + snprintf (msg, sizeof(msg), "Migration of data is not " + "needed when reducing replica count. Use the" + " 'force' option"); errstr = gf_strdup (msg); gf_log (this->name, GF_LOG_ERROR, "%s", errstr); goto out; -- cgit