From: Rishabh Dave Date: Thu, 29 Aug 2019 12:14:14 +0000 (+0530) Subject: qa/mount.py: allow setting mountpoint X-Git-Tag: v14.2.11~42^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=91c0acabd78e9841c6b7effa7dda9737bec321de;p=ceph.git qa/mount.py: allow setting mountpoint Add setter method so that mountpoint for CephFSMount object can be set later. Signed-off-by: Rishabh Dave (cherry picked from commit f1e521a43ba25ea1a764c2f012aebef5c8e0432d) --- diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index a22ae3dcb009..0d925338f23f 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -28,6 +28,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'] @@ -36,8 +37,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()