From 608f2d698569abc82cc671e81477e89e9c553bda Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 19 Sep 2011 15:13:43 +0530 Subject: cli: enable order checking stripe-replicate volumes This is a followup patch to e378778686fca24934e76c41e6496b12162a5420 Enables brick order checking for volumes of type stripe replicate. Change-Id: Ib9b090a3514d05bb7602c423de7d3123f107a3b5 BUG: 2441 Reviewed-on: http://review.gluster.com/455 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System --- cli/src/cli-cmd-volume.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index ec5784176..de3166e8d 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -335,7 +335,13 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word, goto out; } /*Check brick order if type is replicate*/ - if (dict_get_int32 (options, "type", &type) == 0 && type == GF_CLUSTER_TYPE_REPLICATE) { + ret = dict_get_int32 (options, "type", &type); + if (ret) { + gf_log ("cli", GF_LOG_ERROR, "Could not get brick type"); + goto out; + } + if ((type == GF_CLUSTER_TYPE_REPLICATE) || + (type == GF_CLUSTER_TYPE_STRIPE_REPLICATE)) { if ((ret = dict_get_str (options, "bricks", &brick_list)) != 0) { gf_log ("cli", GF_LOG_ERROR, "Replica bricks check : " "Could not retrieve bricks list"); -- cgit