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: v16.2.11~478^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6db94fe45612c62633dfb86e4d59a675d1777c5a;p=ceph.git Add mapping for ernno:13 and adding path in error msg in opendir()/cephfs.pyx Signed-off-by: Sarthak0702 (cherry picked from commit 59ef78cade0016c8f560504af4cc18b0a77f0e1d) --- diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 493b3a2c7763..6752acc966d3 100644 --- a/src/pybind/cephfs/cephfs.pyx +++ b/src/pybind/cephfs/cephfs.pyx @@ -176,7 +176,8 @@ class NotDirectory(OSError): class DiskQuotaExceeded(OSError): pass - +class PermissionDenied(OSError): + pass cdef errno_to_exception = { CEPHFS_EPERM : PermissionError, @@ -192,6 +193,7 @@ cdef errno_to_exception = { CEPHFS_ENOTEMPTY : ObjectNotEmpty, CEPHFS_ENOTDIR : NotDirectory, CEPHFS_EDQUOT : DiskQuotaExceeded, + CEPHFS_EACCES : PermissionDenied, } @@ -939,7 +941,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