]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add mapping for ernno:13 and adding path in error msg in opendir()/cephfs.pyx 46647/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:58 +0000 (00:25 +0530)
Signed-off-by: Sarthak0702 <sarthak.0702@gmail.com>
(cherry picked from commit 59ef78cade0016c8f560504af4cc18b0a77f0e1d)

src/pybind/cephfs/cephfs.pyx

index 96125ba2e43698c0dc13a7d22bc5c0071040a317..f6b3bbb2d7204ddea515391e794074e51bb6b2a8 100644 (file)
@@ -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