From: huangjun Date: Tue, 29 Oct 2013 10:05:35 +0000 (+0800) Subject: fix the bug ctypes.util.find_library to search for librados failed on Centos6.4. X-Git-Tag: v0.73~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e46d2ca067b5b55099a2052d6e1c9729110fb8f9;p=ceph.git fix the bug ctypes.util.find_library to search for librados failed on Centos6.4. Signed-off-by: huangjun --- diff --git a/src/pybind/rados.py b/src/pybind/rados.py index 71c4b0cba320..a27fa02e3f00 100644 --- a/src/pybind/rados.py +++ b/src/pybind/rados.py @@ -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):