with nogil:
ret = ceph_mkdir(self.cluster, _path, _mode)
if ret < 0:
- raise make_ex(ret, "error in mkdir '%s'" % path)
+ raise make_ex(ret, "error in mkdir {}".format(path.decode('utf-8')))
def chmod(self, path, mode) :
"""
with nogil:
ret = ceph_chmod(self.cluster, _path, _mode)
if ret < 0:
- raise make_ex(ret, "error in chmod '%s'" % path)
+ raise make_ex(ret, "error in chmod {}".format(path.decode('utf-8')))
def mkdirs(self, path, mode):
"""
with nogil:
ret = ceph_mkdirs(self.cluster, _path, _mode)
if ret < 0:
- raise make_ex(ret, "error in mkdirs '%s'" % path)
+ raise make_ex(ret, "error in mkdirs {}".format(path.decode('utf-8')))
def rmdir(self, path):
"""
cdef char* _path = path
ret = ceph_rmdir(self.cluster, _path)
if ret < 0:
- raise make_ex(ret, "error in rmdir '%s'" % path)
+ raise make_ex(ret, "error in rmdir {}".format(path.decode('utf-8')))
def open(self, path, flags, mode=0):
"""
with nogil:
ret = ceph_open(self.cluster, _path, _flags, _mode)
if ret < 0:
- raise make_ex(ret, "error in open '%s'" % path)
+ raise make_ex(ret, "error in open {}".format(path.decode('utf-8')))
return ret
def close(self, fd):
# FIXME: replace magic number with CEPH_STATX_BASIC_STATS
ret = ceph_statx(self.cluster, _path, &stx, 0x7ffu, 0)
if ret < 0:
- raise make_ex(ret, "error in stat: %s" % path)
+ raise make_ex(ret, "error in stat: {}".format(path.decode('utf-8')))
return StatResult(st_dev=stx.stx_dev, st_ino=stx.stx_ino,
st_mode=stx.stx_mode, st_nlink=stx.stx_nlink,
st_uid=stx.stx_uid, st_gid=stx.stx_gid,
with nogil:
ret = ceph_unlink(self.cluster, _path)
if ret < 0:
- raise make_ex(ret, "error in unlink: %s" % path)
+ raise make_ex(ret, "error in unlink: {}".format(path.decode('utf-8')))
def rename(self, src, dst):
"""
with nogil:
ret = ceph_rename(self.cluster, _src, _dst)
if ret < 0:
- raise make_ex(ret, "error in rename '%s' to '%s'" % (src, dst))
+ raise make_ex(ret, "error in rename {} to {}".format(src.decode(
+ 'utf-8'), dst.decode('utf-8')))
def mds_command(self, mds_spec, args, input_data):
"""