]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: check mounts attribute in ctx 40634/head
authorJos Collin <jcollin@redhat.com>
Mon, 29 Mar 2021 11:35:04 +0000 (17:05 +0530)
committerJos Collin <jcollin@redhat.com>
Mon, 17 May 2021 09:24:17 +0000 (14:54 +0530)
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 b4b932fe1cf947a487af2cc307be9b0289eca2dc)

qa/tasks/daemonwatchdog.py

index f72ccd7cef3883edf4277426262a914068af348e..c8fa9f3c26fa31057d744f6acfb8378820daad63 100644 (file)
@@ -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)))