"""
ret = abs(ret)
if ret in errno_to_exception:
- return errno_to_exception[ret](ret, msg)
+ e = errno_to_exception[ret](ret, msg)
else:
- return OSError(ret, msg)
+ e = OSError(ret, msg)
+
+ e.errno = ceph_to_hostos_errno(e.errno)
+ return e
class DirEntry(namedtuple('DirEntry',
with nogil:
ret = ceph_create_from_rados(&self.cluster, rados_inst.cluster)
if ret != 0:
- raise Error("libcephfs_initialize failed with error code: %d" % ret)
+ ret = ceph_to_hostos_errno(ret)
+ raise Error(f"libcephfs_initialize failed with error code: {ret}")
self.state = "configuring"
NO_CONF_FILE = -1
with nogil:
ret = ceph_create(&self.cluster, <const char*>_auth_id)
if ret != 0:
- raise Error("libcephfs_initialize failed with error code: %d" % ret)
+ ret = ceph_to_hostos_errno(ret)
+ raise Error(f"libcephfs_initialize failed with error code: {ret}")
self.state = "configuring"
if conffile in (self.NO_CONF_FILE, None):
unsigned short int d_reclen
unsigned char d_type
char d_name[256]
+
+cdef extern from "../include/platform_errno.h":
+ ctypedef signed int int32_t;
+ int32_t ceph_to_hostos_errno(int32_t e)