Skip to content

Commit 7ce3cea

Browse files
committed
mgr/nfs: use helper to validate cephfs path
Signed-off-by: Dhairya Parmar <[email protected]>
1 parent 52ef1f1 commit 7ce3cea

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/pybind/mgr/nfs/export.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -714,14 +714,7 @@ def create_cephfs_export(self,
714714
clients: list = [],
715715
sectype: Optional[List[str]] = None) -> Dict[str, Any]:
716716

717-
try:
718-
cephfs_path_is_dir(self.mgr, fs_name, path)
719-
except NotADirectoryError:
720-
raise NFSException(f"path {path} is not a dir", -errno.ENOTDIR)
721-
except cephfs.ObjectNotFound:
722-
raise NFSObjectNotFound(f"path {path} does not exist")
723-
except cephfs.Error as e:
724-
raise NFSException(e.args[1], -e.args[0])
717+
validate_cephfs_path(self.mgr, fs_name, path)
725718

726719
pseudo_path = normalize_path(pseudo_path)
727720

0 commit comments

Comments
 (0)