From: Jos Collin Date: Mon, 29 Mar 2021 11:35:04 +0000 (+0530) Subject: qa: check mounts attribute in ctx X-Git-Tag: v16.2.5~106^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=38b30cbefac6e751cc11eb86d3c90c019e750158;p=ceph.git qa: check mounts attribute in ctx check mounts attribute in ctx before unmounting in bark() Fixes: https://tracker.ceph.com/issues/49898 Signed-off-by: Jos Collin (cherry picked from commit b4b932fe1cf947a487af2cc307be9b0289eca2dc) --- diff --git a/qa/tasks/daemonwatchdog.py b/qa/tasks/daemonwatchdog.py index f72ccd7cef38..c8fa9f3c26fa 100644 --- a/qa/tasks/daemonwatchdog.py +++ b/qa/tasks/daemonwatchdog.py @@ -55,11 +55,12 @@ class DaemonWatchdog(Greenlet): def bark(self): self.log("BARK! unmounting mounts and killing all daemons") - for mount in self.ctx.mounts.values(): - try: - mount.umount_wait(force=True) - except: - self.logger.exception("ignoring exception:") + if hasattr(self.ctx, 'mounts'): + for mount in self.ctx.mounts.values(): + try: + mount.umount_wait(force=True) + except: + self.logger.exception("ignoring exception:") daemons = [] daemons.extend(filter(lambda daemon: daemon.running() and not daemon.proc.finished, self.ctx.daemons.iter_daemons_of_role('osd', cluster=self.cluster))) daemons.extend(filter(lambda daemon: daemon.running() and not daemon.proc.finished, self.ctx.daemons.iter_daemons_of_role('mds', cluster=self.cluster)))