]> 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)
committerPrashant D <pdhange@redhat.com>
Fri, 1 Mar 2019 01:07:57 +0000 (20:07 -0500)
Fixes: http://tracker.ceph.com/issues/38468
Signed-off-by: songweibin <song.weibin@zte.com.cn>
(cherry picked from commit bb8df22e4ae851d858b081a47f063a1f33b4d0c9)

src/pybind/rbd/rbd.pyx

index 62aff653464c1dc943958df67ed945b9bd74188a..0b65bca75420bec3a0b0b0b9d2c118dfff27237a 100644 (file)
@@ -1615,6 +1615,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.