From e4dd1beae5f18454ffb41ad0da868a1a12e7233f Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 30 Jan 2014 23:04:12 +0200 Subject: [PATCH] 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 --- src/pybind/cephfs.py | 4 ++-- src/pybind/rbd.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pybind/cephfs.py b/src/pybind/cephfs.py index a5e9153a020c0..13a826254fce9 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 26c8df296e03d..97fa9ab609c70 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): """ -- 2.39.5