summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-04-05 15:55:34 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-04-09 11:47:27 +0200
commit9fe57e2bea89243a0080e667f90b7d4fb15ed883 (patch)
tree90d4381519898b9eefc97be36b0e3dac060c74ca
parent1f3b4917cc5c4d796a96637912d2ae5ce2877861 (diff)
downloadceph-9fe57e2bea89243a0080e667f90b7d4fb15ed883.tar.gz
rados.py: fix create_pool()
Call rados_pool_create_with_all() only if auid and crush_rule are set properly. In case only crush_rule is set call rados_pool_create_with_crush_rule() on librados, not the other way around. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de> (cherry picked from commit 94a1f25e7230a700f06a2699c9c2b99ec1bf7144)
-rwxr-xr-xsrc/pybind/rados.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pybind/rados.py b/src/pybind/rados.py
index 09af5ac2aec..3d4e755e852 100755
--- a/src/pybind/rados.py
+++ b/src/pybind/rados.py
@@ -209,15 +209,16 @@ Rados object in state %s." % (self.state))
ret = self.librados.rados_pool_create(
self.cluster, c_char_p(pool_name))
else:
- ret = self.librados.rados_pool_create_with_all(
- self.cluster, c_char_p(pool_name), c_uint64(auid),
- c_ubyte(crush_rule))
+ ret = self.librados.rados_pool_create_with_crush_rule(
+ self.cluster, c_char_p(pool_name), c_ubyte(crush_rule))
+
elif (crush_rule == None):
ret = self.librados.rados_pool_create_with_auid(
self.cluster, c_char_p(pool_name), c_uint64(auid))
else:
- ret = self.librados.rados_pool_create_with_crush_rule(
- self.cluster, c_char_p(pool_name), c_ubyte(crush_rule))
+ ret = self.librados.rados_pool_create_with_all(
+ self.cluster, c_char_p(pool_name), c_uint64(auid),
+ c_ubyte(crush_rule))
if ret < 0:
raise make_ex(ret, "error creating pool '%s'" % pool_name)