]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/mount.py: allow setting mountpoint
authorRishabh Dave <ridave@redhat.com>
Thu, 29 Aug 2019 12:14:14 +0000 (17:44 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 6 Nov 2019 06:06:09 +0000 (11:36 +0530)
Add setter method so that mountpoint for CephFSMount object can be set
later.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/mount.py

index 557b50a661d432f3dac25761e064cda9b53cb7c3..23106aa5e6db1494c9f7659d54c29cb2cc9f3dfd 100644 (file)
@@ -26,6 +26,7 @@ class CephFSMount(object):
         self.client_id = client_id
         self.client_remote = client_remote
         self.mountpoint_dir_name = 'mnt.{id}'.format(id=self.client_id)
+        self._mountpoint = None
         self.fs = None
 
         self.test_files = ['a', 'b', 'c']
@@ -34,8 +35,16 @@ class CephFSMount(object):
 
     @property
     def mountpoint(self):
-        return os.path.join(
-            self.test_dir, '{dir_name}'.format(dir_name=self.mountpoint_dir_name))
+        if self._mountpoint == None:
+            self._mountpoint= os.path.join(
+                self.test_dir, '{dir_name}'.format(dir_name=self.mountpoint_dir_name))
+        return self._mountpoint
+
+    @mountpoint.setter
+    def mountpoint(self, path):
+        if not isinstance(path, str):
+            raise RuntimeError('path should be of str type.')
+        self._mountpoint = path
 
     def is_mounted(self):
         raise NotImplementedError()