From: Dhairya Parmar Date: Wed, 23 Aug 2023 11:49:10 +0000 (+0530) Subject: mgr/nfs: use helper to validate cephfs path X-Git-Tag: v20.0.0~2536^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ce3ceabe1e1be46b7aa96d9dadc956748427487;p=ceph.git mgr/nfs: use helper to validate cephfs path Signed-off-by: Dhairya Parmar --- diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index 8e6dcff7fcb5..31020ee10e2b 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -714,14 +714,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)