]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: fix kernel force umount 12833/head
authorYan, Zheng <zyan@redhat.com>
Mon, 9 Jan 2017 12:47:37 +0000 (20:47 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 10 Jan 2017 00:31:25 +0000 (08:31 +0800)
Fixes: http://tracker.ceph.com/issues/18396
Signed-off-by: Yan, Zheng <zyan@redhat.com>
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