summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@gluster.com>2011-09-19 15:13:43 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-19 04:36:42 -0700
commit608f2d698569abc82cc671e81477e89e9c553bda (patch)
tree8024531e1787b906a0e301962200e9448a79ee45 /cli/src/cli-cmd-volume.c
parent39fee9a8f8264df61f77563acb048a441265afcf (diff)
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 <amar@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index ec578417606..de3166e8d04 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");