]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: fix kernel force umount 14564/head
authorYan, Zheng <zyan@redhat.com>
Mon, 9 Jan 2017 12:47:37 +0000 (20:47 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 14 Apr 2017 21:41:55 +0000 (23:41 +0200)
Fixes: http://tracker.ceph.com/issues/18396
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 4cdeeaac105d7824452a8b578632b7371275b45c)

qa/tasks/cephfs/kernel_mount.py

index 97886de05bec054b22c1c5b1764543c252af3296..191ea7f4b1165fde214a93c8d8eb2c01265ea3ad 100644 (file)
@@ -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