From: Jos Collin Date: Wed, 6 Nov 2019 04:01:28 +0000 (+0530) Subject: qa/tasks: drop/update name from Thrasher X-Git-Tag: v15.1.0~657^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=003550c493c0ca6aae0cbf957ef8afd3938fa559;p=ceph.git qa/tasks: drop/update name from Thrasher * Dropped name setter and property from Thrasher base class * Updated each Thrasher class with a name attribute Signed-off-by: Jos Collin --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index a8f9ed064aa0..bf7d131a6d74 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -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'): diff --git a/qa/tasks/mds_thrash.py b/qa/tasks/mds_thrash.py index 08fe76e82a92..fc5a5514fefa 100644 --- a/qa/tasks/mds_thrash.py +++ b/qa/tasks/mds_thrash.py @@ -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) diff --git a/qa/tasks/mon_thrash.py b/qa/tasks/mon_thrash.py index a074246d3e49..d82141574e22 100644 --- a/qa/tasks/mon_thrash.py +++ b/qa/tasks/mon_thrash.py @@ -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: diff --git a/qa/tasks/rbd_mirror_thrash.py b/qa/tasks/rbd_mirror_thrash.py index fa1e043ed317..2dbe43ceea07 100644 --- a/qa/tasks/rbd_mirror_thrash.py +++ b/qa/tasks/rbd_mirror_thrash.py @@ -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 diff --git a/qa/tasks/thrasher.py b/qa/tasks/thrasher.py index f974745cbd0c..b34c747703ad 100644 --- a/qa/tasks/thrasher.py +++ b/qa/tasks/thrasher.py @@ -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 diff --git a/qa/tasks/thrashosds.py b/qa/tasks/thrashosds.py index c65f79c2b88f..f5149953208a 100644 --- a/qa/tasks/thrashosds.py +++ b/qa/tasks/thrashosds.py @@ -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)