]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Improve readability of the exception 2928/head
authorSébastien Han <sebastien.han@enovance.com>
Thu, 13 Nov 2014 18:11:36 +0000 (19:11 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Fri, 14 Nov 2014 10:00:00 +0000 (11:00 +0100)
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 <sebastien.han@enovance.com>
src/pybind/rados.py

index c574f3908566fb168745b8087d50c4e4a3ebbc89..56771aba0d62271ae7d98c272dde4ffc5296ebc7 100644 (file)
@@ -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):