summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/volume_libs.py
diff options
context:
space:
mode:
authorNigel Babu <nigelb@redhat.com>2018-05-10 20:13:51 +0530
committerNigel Babu <nigelb@redhat.com>2018-05-11 09:40:57 +0000
commit40eb5d29cf5c2c27fe752332c8929f368635d223 (patch)
treee517a98c8e4c6e9c778d53681cdbbb85b0630f6e /glustolibs-gluster/glustolibs/gluster/volume_libs.py
parentab83c20f308ae085e32a8fffb6f33618a0ab5bb7 (diff)
Fix form_bricks_list to work with arbiter
Change-Id: I04d3b8ef5ff08cc50fddf07461874210a08248a6
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/volume_libs.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/volume_libs.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/volume_libs.py b/glustolibs-gluster/glustolibs/gluster/volume_libs.py
index 7ab0db6a5..9eab8c7d4 100644
--- a/glustolibs-gluster/glustolibs/gluster/volume_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/volume_libs.py
@@ -1139,8 +1139,7 @@ def enable_and_validate_volume_options(mnode, volname, volume_options_list,
def form_bricks_list_to_add_brick(mnode, volname, servers, all_servers_info,
add_to_hot_tier=False,
- distribute_count=None,
- replica_count=None):
+ **kwargs):
"""Forms list of bricks to add-bricks to the volume.
Args:
@@ -1177,11 +1176,22 @@ def form_bricks_list_to_add_brick(mnode, volname, servers, all_servers_info,
nonetype: None if there are not enough bricks to add on the servers or
volume doesn't exists or any other failure.
"""
+
# Check if volume exists
if not volume_exists(mnode, volname):
g.log.error("Volume %s doesn't exists.", volname)
return None
+ # Check if the volume has to be expanded by n distribute count.
+ distribute_count = None
+ if 'distribute_count' in kwargs:
+ distribute_count = int(kwargs['distribute_count'])
+
+ # Check whether we need to increase the replica count of the volume
+ replica_count = None
+ if 'replica_count' in kwargs:
+ replica_count = int(kwargs['replica_count'])
+
if replica_count is None and distribute_count is None:
distribute_count = 1