]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: disallow non-existent paths when creating export
authordparmar18 <dparmar@redhat.com>
Thu, 15 Dec 2022 11:24:27 +0000 (16:54 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Thu, 30 Mar 2023 13:59:15 +0000 (19:29 +0530)
Fixes: https://tracker.ceph.com/issues/58228
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
src/pybind/mgr/nfs/export.py

index e6c514ecf53747052a1c8f2cb60ecc470dd3c1e2..935b12464e7b70336a847691f0d7ad2aab518aaa 100644 (file)
@@ -36,7 +36,7 @@ from .utils import (
     conf_obj_name,
     available_clusters,
     check_fs,
-    restart_nfs_service)
+    restart_nfs_service, check_cephfs_path)
 
 if TYPE_CHECKING:
     from nfs.module import Module
@@ -658,6 +658,9 @@ class ExportMgr:
                              access_type: str,
                              clients: list = [],
                              sectype: Optional[List[str]] = None) -> Dict[str, Any]:
+
+        check_cephfs_path(self.mgr, fs_name, path)
+
         pseudo_path = normalize_path(pseudo_path)
 
         if not self._fetch_export(cluster_id, pseudo_path):