Skip to content

Commit

Permalink
rados.py: fix 'Rados' has no member 'name'
Browse files Browse the repository at this point in the history
Lets store rados_id from __init__ and use this instead of 'name'.

Signed-off-by: Danny Al-Gaaf <[email protected]>
  • Loading branch information
dalgaaf committed Mar 21, 2013
1 parent eed8d53 commit d81d2c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pybind/rados.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def require_state(self, *args):
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):
Expand Down Expand Up @@ -196,7 +197,7 @@ def get_cluster_stats(self):
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,
Expand Down

0 comments on commit d81d2c0

Please sign in to comment.