From 1cbca88f8318d6b5abf364656c1263ed34f122f7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 11 Aug 2018 14:00:58 -0500 Subject: [PATCH] pybind/rados: drop auid arg to pool_create Signed-off-by: Sage Weil --- doc/rados/api/python.rst | 3 +-- src/pybind/rados/rados.pyx | 28 ++++++---------------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/doc/rados/api/python.rst b/doc/rados/api/python.rst index cf4a1790b3e..977b603ff89 100644 --- a/doc/rados/api/python.rst +++ b/doc/rados/api/python.rst @@ -314,7 +314,7 @@ first. You may list the available pools, create a pool, check to see if a pool exists, and delete a pool. .. automethod:: Rados.list_pools() -.. automethod:: Rados.create_pool(pool_name, auid=None, crush_rule=None) +.. automethod:: Rados.create_pool(pool_name, crush_rule=None) .. automethod:: Rados.pool_exists() .. automethod:: Rados.delete_pool(pool_name) @@ -331,7 +331,6 @@ invoking methods of the `Ioctx` and other classes. .. automethod:: Rados.open_ioctx(ioctx_name) .. automethod:: Ioctx.require_ioctx_open() .. automethod:: Ioctx.get_stats() -.. automethod:: Ioctx.change_auid(auid) .. automethod:: Ioctx.get_last_version() .. automethod:: Ioctx.close() diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index 44149a21c68..be18a7a5c86 100644 --- a/src/pybind/rados/rados.pyx +++ b/src/pybind/rados/rados.pyx @@ -141,9 +141,7 @@ cdef extern from "rados/librados.h" nogil: int64_t rados_pool_lookup(rados_t cluster, const char *pool_name) int rados_pool_reverse_lookup(rados_t cluster, int64_t id, char *buf, size_t maxlen) int rados_pool_create(rados_t cluster, const char *pool_name) - int rados_pool_create_with_auid(rados_t cluster, const char *pool_name, uint64_t auid) int rados_pool_create_with_crush_rule(rados_t cluster, const char *pool_name, uint8_t crush_rule_num) - int rados_pool_create_with_all(rados_t cluster, const char *pool_name, uint64_t auid, uint8_t crush_rule_num) int rados_pool_get_base_tier(rados_t cluster, int64_t pool, int64_t *base_tier) int rados_pool_list(rados_t cluster, char *buf, size_t len) int rados_pool_delete(rados_t cluster, const char *pool_name) @@ -1023,19 +1021,15 @@ Rados object in state %s." % self.state) finally: free(name) - @requires(('pool_name', str_type), ('auid', opt(int)), ('crush_rule', opt(int))) - def create_pool(self, pool_name, auid=None, crush_rule=None): + @requires(('pool_name', str_type), ('crush_rule', opt(int))) + def create_pool(self, pool_name, crush_rule=None): """ Create a pool: - - with default settings: if auid=None and crush_rule=None - - owned by a specific auid: auid given and crush_rule=None - - with a specific CRUSH rule: if auid=None and crush_rule given - - with a specific CRUSH rule and auid: if auid and crush_rule given + - with default settings: if crush_rule=None + - with a specific CRUSH rule: crush_rule given :param pool_name: name of the pool to create :type pool_name: str - :param auid: the id of the owner of the new pool - :type auid: int :param crush_rule: rule to use for placement in the new pool :type crush_rule: int @@ -1047,24 +1041,14 @@ Rados object in state %s." % self.state) cdef: char *_pool_name = pool_name uint8_t _crush_rule - uint64_t _auid - if auid is None and crush_rule is None: + if crush_rule is None: with nogil: ret = rados_pool_create(self.cluster, _pool_name) - elif auid is None: - _crush_rule = crush_rule - with nogil: - ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) - elif crush_rule is None: - _auid = auid - with nogil: - ret = rados_pool_create_with_auid(self.cluster, _pool_name, _auid) else: - _auid = auid _crush_rule = crush_rule with nogil: - ret = rados_pool_create_with_all(self.cluster, _pool_name, _auid, _crush_rule) + ret = rados_pool_create_with_crush_rule(self.cluster, _pool_name, _crush_rule) if ret < 0: raise make_ex(ret, "error creating pool '%s'" % pool_name) -- 2.39.5