]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: use helper to validate cephfs path
authorDhairya Parmar <dparmar@redhat.com>
Wed, 23 Aug 2023 11:49:10 +0000 (17:19 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Thu, 13 Mar 2025 12:51:40 +0000 (18:21 +0530)
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 7ce3ceabe1e1be46b7aa96d9dadc956748427487)

src/pybind/mgr/nfs/export.py

index 7ed988174015a2ede7f2b20e4fd2067d7aaf2760..35a0fd88f6e65d274ebd6e213b31feec137f3fcf 100644 (file)
@@ -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)