From 088230efe8c43d6acf83b6f202469a5966e8faba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 13 Nov 2014 19:11:36 +0100 Subject: [PATCH] Improve readability of the exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error messages were not really clear from a non-programmer perspective. In the context of OpenStack all the drivers are falling back to the exceptions provided by the rados library. Having clearer error messages will help debugging misconfigured environment. Signed-off-by: Sébastien Han --- src/pybind/rados.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/rados.py b/src/pybind/rados.py index c574f390856..56771aba0d6 100644 --- a/src/pybind/rados.py +++ b/src/pybind/rados.py @@ -421,7 +421,7 @@ Rados object in state %s." % (self.state)) ret = run_in_thread(self.librados.rados_connect, (self.cluster,), timeout) if (ret != 0): - raise make_ex(ret, "error calling connect") + raise make_ex(ret, "error connecting to the cluster") self.state = "connected" def get_cluster_stats(self): @@ -654,12 +654,12 @@ Rados object in state %s." % (self.state)) """ self.require_state("connected") if not isinstance(ioctx_name, str): - raise TypeError('ioctx_name must be a string') + raise TypeError('the name of the pool must be a string') ioctx = c_void_p() ret = run_in_thread(self.librados.rados_ioctx_create, (self.cluster, c_char_p(ioctx_name), byref(ioctx))) if ret < 0: - raise make_ex(ret, "error opening ioctx '%s'" % ioctx_name) + raise make_ex(ret, "error opening pool '%s'" % ioctx_name) return Ioctx(ioctx_name, self.librados, ioctx) def mon_command(self, cmd, inbuf, timeout=0, target=None):