]> git.proxmox.com Git - ceph.git/blobdiff - ceph/doc/rbd/api/librbdpy.rst
import quincy beta 17.1.0
[ceph.git] / ceph / doc / rbd / api / librbdpy.rst
index 981235f87d7545a33feccc927fc96329116f91ec..7a74b049828cdf58fd299485a6eaf9fd59a98a83 100644 (file)
@@ -1,3 +1,5 @@
+.. _rbd api py:
+
 ================
  Librbd (Python)
 ================
@@ -27,7 +29,7 @@ image::
 To perform I/O on the image, you instantiate an :class:rbd.Image object::
 
     image = rbd.Image(ioctx, 'myimage')
-    data = 'foo' * 200
+    data = b'foo' * 200
     image.write(data, 0)
 
 This writes 'foo' to the first 600 bytes of the image. Note that data
@@ -53,7 +55,7 @@ block::
             rbd_inst.create(ioctx, 'myimage', size)
             image = rbd.Image(ioctx, 'myimage')
             try:
-                data = 'foo' * 200
+                data = b'foo' * 200
                 image.write(data, 0)
             finally:
                 image.close()
@@ -73,7 +75,7 @@ above example becomes::
             size = 4 * 1024**3  # 4 GiB
             rbd_inst.create(ioctx, 'myimage', size)
             with rbd.Image(ioctx, 'myimage') as image:
-                data = 'foo' * 200
+                data = b'foo' * 200
                 image.write(data, 0)
 
 API Reference