From: Ilya Dryomov Date: Thu, 30 Jan 2014 21:04:12 +0000 (+0200) Subject: pybind: improve EnvironmentError output X-Git-Tag: v0.78~241^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e4dd1beae5f18454ffb41ad0da868a1a12e7233f;p=ceph.git pybind: improve EnvironmentError output Follow 70c7c9e600c5 ("pybind/rados.py: improve error output") and improve EnvironmentError output for librbd and libcephfs too. Signed-off-by: Ilya Dryomov --- diff --git a/src/pybind/cephfs.py b/src/pybind/cephfs.py index a5e9153a020c..13a826254fce 100644 --- a/src/pybind/cephfs.py +++ b/src/pybind/cephfs.py @@ -127,8 +127,8 @@ def load_libcephfs(): # in addition, it doesn't seem work on centos 6.4 (see e46d2ca067b5) try: return CDLL('libcephfs.so.1') - except OSError: - raise EnvironmentError("Unable to find libcephfs") + except OSError as e: + raise EnvironmentError("Unable to load libcephfs: %s" % e) class LibCephFS(object): """libcephfs python wrapper""" diff --git a/src/pybind/rbd.py b/src/pybind/rbd.py index 26c8df296e03..97fa9ab609c7 100644 --- a/src/pybind/rbd.py +++ b/src/pybind/rbd.py @@ -129,8 +129,8 @@ def load_librbd(): # in addition, it doesn't seem work on centos 6.4 (see e46d2ca067b5) try: return CDLL('librbd.so.1') - except OSError: - raise EnvironmentError("Unable to find librbd") + except OSError as e: + raise EnvironmentError("Unable to load librbd: %s" % e) class RBD(object): """