Skip to content

Commit

Permalink
qa: check mounts attribute in ctx
Browse files Browse the repository at this point in the history
check mounts attribute in ctx before unmounting in bark()

Fixes: https://tracker.ceph.com/issues/49898
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit b4b932f)
  • Loading branch information
joscollin committed May 12, 2022
1 parent 2841f0a commit 546ce3a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions qa/tasks/daemonwatchdog.py
Expand Up @@ -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)))
Expand Down

0 comments on commit 546ce3a

Please sign in to comment.