From d81d2c02d900b89df758c10dea1a6ab0091291f7 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Thu, 21 Mar 2013 18:23:25 +0100 Subject: [PATCH] rados.py: fix 'Rados' has no member 'name' Lets store rados_id from __init__ and use this instead of 'name'. Signed-off-by: Danny Al-Gaaf --- src/pybind/rados.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/rados.py b/src/pybind/rados.py index 9c601d6c22480..6a418de0ef320 100755 --- a/src/pybind/rados.py +++ b/src/pybind/rados.py @@ -107,6 +107,7 @@ Rados object in state %s." % (self.state)) def __init__(self, rados_id=None, conf=None, conffile=None): self.librados = CDLL('librados.so.2') self.cluster = c_void_p() + self.rados_id = rados_id if rados_id is not None and not isinstance(rados_id, str): raise TypeError('rados_id must be a string or None') if conffile is not None and not isinstance(conffile, str): @@ -196,7 +197,7 @@ Rados object in state %s." % (self.state)) ret = self.librados.rados_cluster_stat(self.cluster, byref(stats)) if ret < 0: raise make_ex( - ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.name) + ret, "Rados.get_cluster_stats(%s): get_stats failed" % self.rados_id) return {'kb': stats.kb, 'kb_used': stats.kb_used, 'kb_avail': stats.kb_avail, -- 2.39.5