]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/vstart_runner: use parent's umount methods 34801/head
authorXiubo Li <xiubli@redhat.com>
Thu, 5 Mar 2020 01:59:04 +0000 (20:59 -0500)
committerNathan Cutler <ncutler@suse.com>
Tue, 28 Apr 2020 17:31:24 +0000 (19:31 +0200)
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 95820bf48f24579a099a2acf02575cddb3295c4a)

qa/tasks/cephfs/fuse_mount.py
qa/tasks/cephfs/kernel_mount.py
qa/tasks/vstart_runner.py

index 21a9a6d2f16b803833faf09a7fc6555cd4b8b932..6ca08a460b816350f78acc85636f29668bb4a170 100644 (file)
@@ -244,6 +244,9 @@ class FuseMount(CephFSMount):
         return self.client_remote.run(args=["ls", "-d", self.mountpoint], check_status=False, cwd=self.test_dir, timeout=(15*60)).exitstatus == 0
 
     def umount(self):
+        if not self.is_mounted():
+            return
+
         try:
             log.info('Running fusermount -u on {name}...'.format(name=self.client_remote.name))
             self.client_remote.run(
index 86a06006df752e084ccee6749e2976c7c48b8fac..8e4eeb66a96a30dd237b391874aa32e74ebb411d 100644 (file)
@@ -74,6 +74,9 @@ class KernelMount(CephFSMount):
         self.mounted = True
 
     def umount(self, force=False):
+        if not self.is_mounted():
+            return
+
         log.debug('Unmounting client client.{id}...'.format(id=self.client_id))
 
         cmd=['sudo', 'umount', self.mountpoint]
index 7055ebb7c9d8d71fe8eb5285704932e584e9c97b..8b57fd540671b19ad9155def002a60eb353a1870 100644 (file)
@@ -615,33 +615,6 @@ class LocalKernelMount(KernelMount):
         log.info("I think my launching pid was {0}".format(self.fuse_daemon.subproc.pid))
         return path
 
-    def umount(self, force=False):
-        log.debug('Unmounting client client.{id}...'.format(id=self.client_id))
-
-        cmd=['sudo', 'umount', self.mountpoint]
-        if force:
-            cmd.append('-f')
-
-        try:
-            self.client_remote.run(args=cmd, timeout=(15*60), omit_sudo=False)
-        except Exception as e:
-            self.client_remote.run(args=[
-                'sudo',
-                Raw('PATH=/usr/sbin:$PATH'),
-                'lsof',
-                Raw(';'),
-                'ps', 'auxf',
-            ], timeout=(15*60), omit_sudo=False)
-            raise e
-
-        rproc = self.client_remote.run(args=[
-                'rmdir',
-                '--',
-                self.mountpoint,
-            ])
-        rproc.wait()
-        self.mounted = False
-
     def mount(self, mount_path=None, mount_fs_name=None, mount_options=[]):
         self.setupfs(name=mount_fs_name)
 
@@ -803,10 +776,6 @@ class LocalFuseMount(FuseMount):
         log.info("I think my launching pid was {0}".format(self.fuse_daemon.subproc.pid))
         return path
 
-    def umount(self):
-        if self.is_mounted():
-            super(LocalFuseMount, self).umount()
-
     def mount(self, mount_path=None, mount_fs_name=None, mountpoint=None, mount_options=[]):
         if mountpoint is not None:
             self.mountpoint = mountpoint