From ae1af60b3d63ce92d3298f94439e1af0986f62c6 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Mon, 29 Mar 2021 17:05:04 +0530 Subject: [PATCH] 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) --- qa/tasks/daemonwatchdog.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qa/tasks/daemonwatchdog.py b/qa/tasks/daemonwatchdog.py index b95c29920ddd50..14817fee7fd03f 100644 --- a/qa/tasks/daemonwatchdog.py +++ b/qa/tasks/daemonwatchdog.py @@ -50,11 +50,12 @@ def stop(self): 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)))