From: Dhairya Parmar Date: Wed, 23 Aug 2023 11:49:10 +0000 (+0530) Subject: mgr/nfs: use helper to validate cephfs path X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0da635c1833a053ab3dad889a31e7c94c9002362;p=ceph.git mgr/nfs: use helper to validate cephfs path Signed-off-by: Dhairya Parmar (cherry picked from commit 7ce3ceabe1e1be46b7aa96d9dadc956748427487) --- diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index 7ed988174015..35a0fd88f6e6 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -693,14 +693,7 @@ class ExportMgr: clients: list = [], sectype: Optional[List[str]] = None) -> Dict[str, Any]: - try: - cephfs_path_is_dir(self.mgr, fs_name, path) - except NotADirectoryError: - raise NFSException(f"path {path} is not a dir", -errno.ENOTDIR) - except cephfs.ObjectNotFound: - raise NFSObjectNotFound(f"path {path} does not exist") - except cephfs.Error as e: - raise NFSException(e.args[1], -e.args[0]) + validate_cephfs_path(self.mgr, fs_name, path) pseudo_path = normalize_path(pseudo_path)