]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc: data must be a byte string 43671/head
authorJavier Cacheiro <jlopez@cesga.es>
Tue, 26 Oct 2021 15:14:15 +0000 (17:14 +0200)
committerJavier Cacheiro <jlopez@cesga.es>
Tue, 26 Oct 2021 15:14:15 +0000 (17:14 +0200)
Data must be a byte string in python 3.

Signed-off-by: Javier Cacheiro <javier.cacheiro.lopez@cesga.es>
doc/rbd/api/librbdpy.rst

index dc01f2373ae934a8177cbe2588c91d5dc48a5c4d..7a74b049828cdf58fd299485a6eaf9fd59a98a83 100644 (file)
@@ -29,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
@@ -55,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()
@@ -75,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