]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fix the bug ctypes.util.find_library to search for librados failed on Centos6.4. 781/head 858/head 859/head
authorhuangjun <hjwsm1989@gmail.com>
Tue, 29 Oct 2013 10:05:35 +0000 (18:05 +0800)
committerhuangjun <hjwsm1989@gmail.com>
Tue, 29 Oct 2013 10:05:35 +0000 (18:05 +0800)
Signed-off-by: huangjun <hjwsm1989@gmail.com>
src/pybind/rados.py

index 71c4b0cba320227d550a3b9ea06bca59a4cab982..a27fa02e3f003c36e3d5cb39a862f15284401841 100644 (file)
@@ -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):