summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs
diff options
context:
space:
mode:
Diffstat (limited to 'openshift-storage-libs')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/gluster_ops.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py b/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py
index 1b2c295..f621a86 100644
--- a/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py
+++ b/openshift-storage-libs/openshiftstoragelibs/gluster_ops.py
@@ -27,11 +27,26 @@ from openshiftstoragelibs import waiter
@podcmd.GlustoPod()
def wait_to_heal_complete(
- timeout=300, wait_step=5, g_node="auto_get_gluster_endpoint"):
- """Monitors heal for volumes on gluster"""
- gluster_vol_list = get_volume_list(g_node)
- if not gluster_vol_list:
- raise AssertionError("failed to get gluster volume list")
+ vol_name=None, g_node="auto_get_gluster_endpoint",
+ timeout=300, wait_step=5):
+ """Monitors heal for volumes on gluster
+
+ Args:
+ vol_name (str): Name of the gluster volume else default is None and
+ will check for all the volumes
+ g_node (str): Name of the gluster node else default is
+ auto_get_gluster_endpoint
+ timeout (int): Time to wait for heal check to complete default is 300
+ wait_step (int): Time to trigger heal check command for next iteration
+ Raises:
+ AssertionError: In case heal is not complete
+ """
+ if not vol_name:
+ gluster_vol_list = get_volume_list(g_node)
+ if not gluster_vol_list:
+ raise AssertionError("failed to get gluster volume list")
+ else:
+ gluster_vol_list = [vol_name]
_waiter = waiter.Waiter(timeout=timeout, interval=wait_step)
for gluster_vol in gluster_vol_list: