]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd/pybind: add __enter__ and __exit__ for class Group
authorsongweibin <song.weibin@zte.com.cn>
Mon, 25 Feb 2019 06:58:44 +0000 (14:58 +0800)
committersongweibin <song.weibin@zte.com.cn>
Mon, 25 Feb 2019 06:58:44 +0000 (14:58 +0800)
Fixes: http://tracker.ceph.com/issues/38468
Signed-off-by: songweibin <song.weibin@zte.com.cn>
src/pybind/rbd/rbd.pyx

index 452ef3b7c340f8469c17708b2f84d82ceb64bf67..2ff57b3f738c781ad961ab8f0e2703eb9b4deed0 100644 (file)
@@ -2531,6 +2531,12 @@ cdef class Group(object):
         self._ioctx = convert_ioctx(ioctx)
         self._name = name
 
+    def __enter__(self):
+        return self
+
+    def __exit__(self, type_, value, traceback):
+        return False
+
     def add_image(self, image_ioctx, image_name):
         """
         Add an image to a group.