]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: check mounts attribute in ctx 45633/head
authorJos Collin <jcollin@redhat.com>
Mon, 29 Mar 2021 11:35:04 +0000 (17:05 +0530)
committerJos Collin <jcollin@redhat.com>
Thu, 12 May 2022 09:00:32 +0000 (14:30 +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 b95c29920ddd50733690f075f22c553e1ee2b1e3..14817fee7fd03f6ff4ad17ed0a42026d005494ed 100644 (file)
@@ -50,11 +50,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)))