From 1fe0330abe5f9d14e9b8998564efa4e6a6be4349 Mon Sep 17 00:00:00 2001 From: Benjamin Wilson Date: Wed, 16 Dec 2015 16:39:42 -0500 Subject: [PATCH] Properly handle adding multiple bricks to volume --- system/gluster_volume.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/gluster_volume.py b/system/gluster_volume.py index ff1ce9831db..24a4c3a2fc0 100644 --- a/system/gluster_volume.py +++ b/system/gluster_volume.py @@ -289,8 +289,9 @@ def stop_volume(name): def set_volume_option(name, option, parameter): run_gluster([ 'volume', 'set', name, option, parameter ]) -def add_brick(name, brick, force): - args = [ 'volume', 'add-brick', name, brick ] +def add_bricks(name, new_bricks, force): + args = [ 'volume', 'add-brick', name ] + args.extend(new_bricks) if force: args.append('force') run_gluster(args) @@ -408,8 +409,8 @@ def main(): if brick not in all_bricks: removed_bricks.append(brick) - for brick in new_bricks: - add_brick(volume_name, brick, force) + if new_bricks: + add_bricks(volume_name, new_bricks, force) changed = True # handle quotas