]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Add mapping for ernno:13 and adding path in error msg in opendir()/cephfs.pyx 46646/head
authorSarthak0702 <sarthak.0702@gmail.com>
Mon, 21 Feb 2022 12:33:30 +0000 (18:03 +0530)
committerSarthak0702 <sarthak.dev.0702@gmail.com>
Mon, 13 Jun 2022 18:55:09 +0000 (00:25 +0530)
Signed-off-by: Sarthak0702 <sarthak.0702@gmail.com>
(cherry picked from commit 59ef78cade0016c8f560504af4cc18b0a77f0e1d)

src/pybind/cephfs/cephfs.pyx

index 493b3a2c77636807881fd9f4cc9ff278d014b8af..6752acc966d383ed248f40ea9bced993c1d293e1 100644 (file)
@@ -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