summaryrefslogtreecommitdiffstats
path: root/src/pybind
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@inktank.com>2014-03-19 19:00:58 +0100
committerJosh Durgin <josh.durgin@inktank.com>2014-03-19 19:00:58 +0100
commitcffcf10ff6ab0b618a3148dff92de1e00253b782 (patch)
treed18ef50af235d48bd899bbb7ff53c7174a81e9a5 /src/pybind
parentMerge pull request #1504 from ceph/wip-7780 (diff)
parentrados.py: add aio_remove (diff)
downloadceph-cffcf10ff6ab0b618a3148dff92de1e00253b782.tar.xz
ceph-cffcf10ff6ab0b618a3148dff92de1e00253b782.zip
Merge pull request #1312 from cernceph/master
rados.py: add aio_remove Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'src/pybind')
-rw-r--r--src/pybind/rados.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/pybind/rados.py b/src/pybind/rados.py
index b4a3a46ef2d..098e200c889 100644
--- a/src/pybind/rados.py
+++ b/src/pybind/rados.py
@@ -1100,6 +1100,30 @@ class Ioctx(object):
raise make_ex(ret, "error reading %s" % object_name)
return completion
+ def aio_remove(self, object_name, oncomplete=None, onsafe=None):
+ """
+ Asychronously remove an object
+
+ :param object_name: name of the object to remove
+ :type object_name: str
+ :param oncomplete: what to do when the remove is safe and complete in memory
+ on all replicas
+ :type oncomplete: completion
+ :param onsafe: what to do when the remove is safe and complete on storage
+ on all replicas
+ :type onsafe: completion
+
+ :raises: :class:`Error`
+ :returns: completion object
+ """
+ completion = self.__get_completion(oncomplete, onsafe)
+ ret = run_in_thread(self.librados.rados_aio_remove,
+ (self.io, c_char_p(object_name),
+ completion.rados_comp))
+ if ret < 0:
+ raise make_ex(ret, "error removing %s" % object_name)
+ return completion
+
def require_ioctx_open(self):
"""
Checks if the rados.Ioctx object state is 'open'