summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Kumar <aanand01762@gmail.com>2020-07-20 11:24:15 +0530
committerArun Kumar <aanand01762@gmail.com>2020-07-29 10:36:03 +0530
commitc813ecc643041b86061bfd0ad8a33866e83abb8e (patch)
treea2878cb9fd4e26da11a723a0bfab75b5e51ef10e
parentabf3baef0973ca7bdf335130a24f122eeed7ab22 (diff)
[LibFix] Add support for heal check of one particular volume
Change-Id: Ib99aec711c2ae520a373bb2673ac58dd51c3c070 Signed-off-by: Arun Kumar <aanand01762@gmail.com>
-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: