]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: drop/update name from Thrasher
authorJos Collin <jcollin@redhat.com>
Wed, 6 Nov 2019 04:01:28 +0000 (09:31 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 27 Nov 2019 02:57:04 +0000 (08:27 +0530)
* Dropped name setter and property from Thrasher base class
* Updated each Thrasher class with a name attribute

Signed-off-by: Jos Collin <jcollin@redhat.com>
qa/tasks/ceph_manager.py
qa/tasks/mds_thrash.py
qa/tasks/mon_thrash.py
qa/tasks/rbd_mirror_thrash.py
qa/tasks/thrasher.py
qa/tasks/thrashosds.py

index a8f9ed064aa0539a75c4863c70d9d76175800a6b..bf7d131a6d74f122970621d6ac4b4efc5c4afec4 100644 (file)
@@ -105,8 +105,8 @@ class OSDThrasher(Thrasher):
     """
     Object used to thrash Ceph
     """
-    def __init__(self, manager, config, logger):
-        Thrasher.__init__(self, "OSDThrasher")
+    def __init__(self, manager, config, name, logger):
+        super(OSDThrasher, self).__init__()
 
         self.ceph_manager = manager
         self.cluster = manager.cluster
@@ -119,6 +119,7 @@ class OSDThrasher(Thrasher):
         self.stopping = False
         self.logger = logger
         self.config = config
+        self.name = name
         self.revive_timeout = self.config.get("revive_timeout", 360)
         self.pools_to_fix_pgp_num = set()
         if self.config.get('powercycle'):
index 08fe76e82a9288e35cf99bd63250590de97721e0..fc5a5514fefa1a6d60d2ef8c39f191446ce5afb0 100644 (file)
@@ -18,7 +18,7 @@ from tasks.thrasher import Thrasher
 
 log = logging.getLogger(__name__)
 
-class MDSThrasher(Greenlet, Thrasher):
+class MDSThrasher(Thrasher, Greenlet):
     """
     MDSThrasher::
 
@@ -98,8 +98,7 @@ class MDSThrasher(Greenlet, Thrasher):
     """
 
     def __init__(self, ctx, manager, config, fs, max_mds):
-        Greenlet.__init__(self)
-        Thrasher.__init__(self, "MDSThrasher")
+        super(MDSThrasher, self).__init__()
 
         self.config = config
         self.ctx = ctx
@@ -417,7 +416,6 @@ def task(ctx, config):
 
     for fs in status.get_filesystems():
         thrasher = MDSThrasher(ctx, manager, config, Filesystem(ctx, fs['id']), fs['mdsmap']['max_mds'])
-        thrasher.name = thrasher.name + " on fs." + thrasher.fs.name
         thrasher.start()
         ctx.ceph[config['cluster']].thrashers.append(thrasher)
 
index a074246d3e49027baceef4eca0f41e8474ee3bd8..d82141574e221b1df80fc890b8b0c32df6195a8e 100644 (file)
@@ -85,8 +85,8 @@ class MonitorThrasher(Thrasher):
           all:
             - mon/workloadgen.sh
     """
-    def __init__(self, ctx, manager, config, logger):
-        Thrasher.__init__(self, "MonitorThrasher")
+    def __init__(self, ctx, manager, config, name, logger):
+        super(MonitorThrasher, self).__init__()
 
         self.ctx = ctx
         self.manager = manager
@@ -95,6 +95,7 @@ class MonitorThrasher(Thrasher):
         self.stopping = False
         self.logger = logger
         self.config = config
+        self.name = name
 
         if self.config is None:
             self.config = dict()
@@ -372,7 +373,7 @@ def task(ctx, config):
         logger=log.getChild('ceph_manager'),
         )
     thrash_proc = MonitorThrasher(ctx,
-        manager, config,
+        manager, config, "MonitorThrasher",
         logger=log.getChild('mon_thrasher'))
     ctx.ceph[config['cluster']].thrashers.append(thrash_proc)
     try:
index fa1e043ed317c1938fa391bcb98c084e9daa62be..2dbe43ceea071c6cdd13231a9ac4d99dbcc3dd55 100644 (file)
@@ -22,7 +22,7 @@ from tasks.thrasher import Thrasher
 log = logging.getLogger(__name__)
 
 
-class RBDMirrorThrasher(Greenlet, Thrasher):
+class RBDMirrorThrasher(Thrasher, Greenlet):
     """
     RBDMirrorThrasher::
 
@@ -64,8 +64,7 @@ class RBDMirrorThrasher(Greenlet, Thrasher):
     """
 
     def __init__(self, ctx, config, cluster, daemons):
-        Greenlet.__init__(self)
-        Thrasher.__init__(self, "RBDMirrorThrasher")
+        super(RBDMirrorThrasher, self).__init__()
 
         self.ctx = ctx
         self.config = config
index f974745cbd0cbcd021e9c398da23c9efde02a205..b34c747703adc24bb2f8d70bb553aa047c2cbdb2 100644 (file)
@@ -3,10 +3,9 @@ Thrasher base class
 """
 class Thrasher(object):
 
-    def __init__(self, n):
+    def __init__(self):
         super(Thrasher, self).__init__()
         self._exception = None
-        self._name = n
 
     @property
     def exception(self):
@@ -15,11 +14,3 @@ class Thrasher(object):
     @exception.setter
     def exception(self, e):
         self._exception = e
-
-    @property
-    def name(self):
-        return self._name
-
-    @name.setter
-    def name(self, n):
-        self._name = n
index c65f79c2b88f406c66f1ccf103c6960820b138a3..f5149953208ae1c92fba4750d85d08f11529262f 100644 (file)
@@ -203,6 +203,7 @@ def task(ctx, config):
     thrash_proc = ceph_manager.OSDThrasher(
         cluster_manager,
         config,
+        "OSDThrasher",
         logger=log.getChild('thrasher')
         )
     ctx.ceph[cluster].thrashers.append(thrash_proc)