int ceph_debug_get_fd_caps(ceph_mount_info *cmount, int fd)
int ceph_debug_get_file_caps(ceph_mount_info *cmount, const char *path)
uint32_t ceph_get_cap_return_timeout(ceph_mount_info *cmount)
+ void ceph_set_uuid(ceph_mount_info *cmount, const char *uuid)
+ void ceph_set_session_timeout(ceph_mount_info *cmount, unsigned timeout)
class Error(Exception):
raise make_ex(ret, "error in get_cap_return_timeout")
return ret
+
+ def set_uuid(self, uuid):
+ """
+ Set ceph client uuid. Must be called before mount.
+
+ :param uuid: the uuid to set
+ """
+
+ uuid = cstr(uuid, 'uuid')
+
+ cdef:
+ char* _uuid = uuid
+
+ with nogil:
+ ceph_set_uuid(self.cluster, _uuid)
+
+ def set_session_timeout(self, timeout):
+ """
+ Set ceph client session timeout. Must be called before mount.
+
+ :param timeout: the timeout to set
+ """
+
+ if not isinstance(timeout, int):
+ raise TypeError('timeout must be an int')
+
+ cdef:
+ int _timeout = timeout
+
+ with nogil:
+ ceph_set_session_timeout(self.cluster, _timeout)
import os
import time
import stat
+import uuid
from datetime import datetime
cephfs = None
assert_equal(fd_caps, file_caps)
cephfs.close(fd)
cephfs.unlink(b'/file-caps')
+
+@with_setup(setup_test)
+def test_setuuid():
+ ses_id_uid = uuid.uuid1()
+ ses_id_str = str(ses_id_uid)
+ cephfs.set_uuid(ses_id_str)
+
+@with_setup(setup_test)
+def test_session_timeout():
+ assert_raises(TypeError, cephfs.set_session_timeout, "300")
+ cephfs.set_session_timeout(300)