mirror of
https://github.com/ceph/ceph
synced 2025-04-01 14:51:13 +00:00
fix the bug ctypes.util.find_library to search for librados failed on Centos6.4.
Signed-off-by: huangjun <hjwsm1989@gmail.com>
This commit is contained in:
parent
702234d7a2
commit
e46d2ca067
@ -197,8 +197,15 @@ Rados object in state %s." % (self.state))
|
||||
conf_defaults=None, conffile=None, conf=None, flags=0):
|
||||
librados_path = find_library('rados')
|
||||
if not librados_path:
|
||||
raise EnvironmentError("Unable to find librados")
|
||||
self.librados = CDLL(librados_path)
|
||||
#maybe find_library can not find it correctly on all platforms.
|
||||
try:
|
||||
self.librados = CDLL('librados.so.2')
|
||||
except OSError:
|
||||
raise EnvironmentError("Unable to find librados")
|
||||
except:
|
||||
raise Error("Unexpected error")
|
||||
else:
|
||||
self.librados = CDLL(librados_path)
|
||||
self.cluster = c_void_p()
|
||||
self.rados_id = rados_id
|
||||
if rados_id is not None and not isinstance(rados_id, str):
|
||||
|
Loading…
Reference in New Issue
Block a user