From: Sébastien Han Date: Thu, 13 Nov 2014 18:11:36 +0000 (+0100) Subject: Improve readability of the exception X-Git-Tag: v0.90~90^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=088230efe8c43d6acf83b6f202469a5966e8faba;p=ceph.git Improve readability of the exception 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 --- diff --git a/src/pybind/rados.py b/src/pybind/rados.py index c574f3908566..56771aba0d62 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):