summaryrefslogtreecommitdiff
path: root/src/pybind/rados.py
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@inktank.com>2013-08-14 15:50:59 -0700
committerJosh Durgin <josh.durgin@inktank.com>2013-08-14 15:51:04 -0700
commit13a073c8586e7967cfa5c301f24622746b53b281 (patch)
tree31b01af94c76588ab6bc1dd247c5c68900b518c1 /src/pybind/rados.py
parentb6a9b6dcf2f4de3ac22e6a7e3756c7e94c791b09 (diff)
downloadceph-wip-5970.tar.gz
rados.py: fix Rados() unicode checkingwip-5970
Check new parameters and check that rados_id is not None again to catch the empty string. Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'src/pybind/rados.py')
-rw-r--r--src/pybind/rados.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pybind/rados.py b/src/pybind/rados.py
index 34d83c7b353..7768f8c39d3 100644
--- a/src/pybind/rados.py
+++ b/src/pybind/rados.py
@@ -187,10 +187,14 @@ Rados object in state %s." % (self.state))
self.librados = CDLL('librados.so.2')
self.cluster = c_void_p()
self.rados_id = rados_id
- if rados_id and not isinstance(rados_id, str):
+ 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):
raise TypeError('conffile must be a string or None')
+ if name is not None and not isinstance(name, str):
+ raise TypeError('name must be a string or None')
+ if clustername is not None and not isinstance(clustername, str):
+ raise TypeError('clustername must be a string or None')
if rados_id and name:
raise Error("Rados(): can't supply both rados_id and name")
if rados_id: