]> 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>
Tue, 30 Jan 2024 09:47:35 +0000 (15:17 +0530)
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
src/pybind/mgr/nfs/export.py

index 8e6dcff7fcb5e27dfc36db57fc9653990fa5279a..31020ee10e2b26aed8e97f8edfc5e0556d4b065e 100644 (file)
@@ -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)