From: Sarthak0702 Date: Mon, 21 Feb 2022 12:33:30 +0000 (+0530) Subject: Add mapping for ernno:13 and adding path in error msg in opendir()/cephfs.pyx X-Git-Tag: v18.0.0~1250^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=59ef78cade0016c8f560504af4cc18b0a77f0e1d;p=ceph-ci.git Add mapping for ernno:13 and adding path in error msg in opendir()/cephfs.pyx Signed-off-by: Sarthak0702 --- diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 96125ba2e43..f6b3bbb2d72 100644 --- a/src/pybind/cephfs/cephfs.pyx +++ b/src/pybind/cephfs/cephfs.pyx @@ -177,7 +177,8 @@ class NotDirectory(OSError): class DiskQuotaExceeded(OSError): pass - +class PermissionDenied(OSError): + pass cdef errno_to_exception = { CEPHFS_EPERM : PermissionError, @@ -193,6 +194,7 @@ cdef errno_to_exception = { CEPHFS_ENOTEMPTY : ObjectNotEmpty, CEPHFS_ENOTDIR : NotDirectory, CEPHFS_EDQUOT : DiskQuotaExceeded, + CEPHFS_EACCES : PermissionDenied, } @@ -938,7 +940,7 @@ cdef class LibCephFS(object): with nogil: ret = ceph_opendir(self.cluster, _path, &handle); if ret < 0: - raise make_ex(ret, "opendir failed") + raise make_ex(ret, "opendir failed at {}".format(path.decode('utf-8'))) d = DirResult() d.lib = self d.handle = handle