summaryrefslogtreecommitdiffstats
path: root/libs/utils
diff options
context:
space:
mode:
Diffstat (limited to 'libs/utils')
-rw-r--r--libs/utils/glusterutils.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/libs/utils/glusterutils.py b/libs/utils/glusterutils.py
index 7ab41d0..551d23e 100644
--- a/libs/utils/glusterutils.py
+++ b/libs/utils/glusterutils.py
@@ -277,18 +277,26 @@ def volume_create(serverkey):
"""
"""
logger = GlobalObj.getLoggerObj()
- base_command = "gluster volume create "
+ base_command = "gluster volume create"
+ command = [base_command]
env = GlobalObj.getTestenvObj()
cm = GlobalObj.getConnectionsManagerObj()
active_volume = env.getActiveVolume()
if not active_volume:
logger.error("ActiveVolume not defined for the TestEnvironment")
return 1
+ command.extend([active_volume.volumename])
+
+ if active_volume.replica:
+ command.extend(["replica", active_volume.replica])
- command = ' '.join([base_command, active_volume.volumename,
- active_volume.volumetype, active_volume.count,
- "transport", active_volume.transporttype])
+ if active_volume.stripe:
+ command.extend(["stripe", active_volume.stripe])
+
+ if active_volume.transporttype:
+ command.extend(["transport", active_volume.transporttype])
+ command = ' '.join(command)
for brick_obj in active_volume.bricks:
brick_value = brick_obj.hostname + ":" + brick_obj.path
command = ' '.join([command, brick_value])