summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-06-16 11:50:05 +0530
committerArthy Loganathan <aloganat@redhat.com>2020-06-16 07:33:12 +0000
commitecd9b4527880e7b4035867eade53b0008cc7e30f (patch)
tree30d3f0fe294aaaf75dc13815c1298428aa7c39d4 /glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
parent0c51170b87c6d13d82f802e4174520f20064c49a (diff)
[Lib] Add library for reset-failed
Adding library function reset_failed_glusterd() and modifying scratch_cleanup() to use reset_failed_glusterd(). This is needed because of patch [1] and [2] sent to glusterfs where changes are made to glusterd.service.in to not allow glusterd restart for more than 6 times within an hour. Links: [1] https://review.gluster.org/#/c/glusterfs/+/23751/ [2] https://review.gluster.org/#/c/glusterfs/+/23970/ Change-Id: I25f982517420f20f11a610e8a68afc71f3b7f2a9 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/gluster_base_class.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/gluster_base_class.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
index d27b9ad3e..93e906fdb 100644
--- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
+++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
@@ -45,7 +45,8 @@ from glustolibs.gluster.peer_ops import (
peer_probe_servers, peer_status
)
from glustolibs.gluster.gluster_init import (
- restart_glusterd, stop_glusterd, wait_for_glusterd_to_start)
+ restart_glusterd, stop_glusterd, wait_for_glusterd_to_start,
+ reset_failed_glusterd)
from glustolibs.gluster.samba_libs import share_volume_over_smb
from glustolibs.gluster.volume_libs import (
cleanup_volume,
@@ -290,8 +291,18 @@ class GlusterBaseClass(TestCase):
return False
ret = restart_glusterd(cls.servers)
if not ret:
- g.log.error("Failed to start glusterd")
- return False
+ # Due to recent changes in glusterd.service.in
+ # we can only restart glusterd 6 times in an hour
+ # if not then we would need reset-failed glusterd
+ # and restart glusterd
+ ret = reset_failed_glusterd(cls.servers)
+ if not ret:
+ g.log.error("Failed to reset glusterd")
+ return False
+ ret = restart_glusterd(cls.servers)
+ if not ret:
+ g.log.error("Failed to start glusterd")
+ return False
sleep(2)
ret = wait_for_glusterd_to_start(cls.servers)
if not ret: