From 4cdeeaac105d7824452a8b578632b7371275b45c Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 9 Jan 2017 20:47:37 +0800 Subject: [PATCH] qa/tasks/cephfs: fix kernel force umount Fixes: http://tracker.ceph.com/issues/18396 Signed-off-by: Yan, Zheng --- qa/tasks/cephfs/kernel_mount.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index 97886de05bec0..191ea7f4b1165 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -87,15 +87,15 @@ class KernelMount(CephFSMount): self.mounted = True - def umount(self): + def umount(self, force=False): log.debug('Unmounting client client.{id}...'.format(id=self.client_id)) - self.client_remote.run( - args=[ - 'sudo', - 'umount', - self.mountpoint, - ], - ) + + cmd=['sudo', 'umount', self.mountpoint] + if force: + cmd.append('-f') + + self.client_remote.run(args=cmd) + self.client_remote.run( args=[ 'rmdir', @@ -116,7 +116,7 @@ class KernelMount(CephFSMount): return try: - self.umount() + self.umount(force) except CommandFailedError: if not force: raise -- 2.39.5