From 59ef78cade0016c8f560504af4cc18b0a77f0e1d Mon Sep 17 00:00:00 2001 From: Sarthak0702 Date: Mon, 21 Feb 2022 18:03:30 +0530 Subject: [PATCH] Add mapping for ernno:13 and adding path in error msg in opendir()/cephfs.pyx Signed-off-by: Sarthak0702 --- src/pybind/cephfs/cephfs.pyx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 96125ba2e436..f6b3bbb2d720 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 -- 2.47.3