From 48d97fe79634d4d4bb7ea2237083c3cd694ff3fe Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Wed, 16 May 2012 13:42:55 -0700 Subject: [PATCH] doc: add ioctx parameter to rbd pybind examples. This parameter is required and was missing. And fix a typo --- doc/api/librbdpy.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/api/librbdpy.rst b/doc/api/librbdpy.rst index 6298a6e41e1a2..3ded7e88aa72e 100644 --- a/doc/api/librbdpy.rst +++ b/doc/api/librbdpy.rst @@ -22,11 +22,11 @@ image:: rbd_inst = rbd.RBD() size = 4 * 1024 * 1024 # 4 GiB - rbd_inst.create('myimage', 4) + rbd_inst.create(ioctx, 'myimage', 4) To perform I/O on the image, you instantiate an :class:rbd.Image object:: - image = rbd.Image('myimage') + image = rbd.Image(ioctx, 'myimage') data = 'foo' * 200 image.write(data, 0) @@ -49,8 +49,8 @@ block:: try: rbd_inst = rbd.RBD() size = 4 * 1024 * 1024 # 4 GiB - rbd_inst.create('myimage', 4) - image = rbd.Image('myimage') + rbd_inst.create(ioctx, 'myimage', 4) + image = rbd.Image(ioctx, 'myimage') try: data = 'foo' * 200 image.write(data, 0) @@ -69,8 +69,8 @@ classes can be used as context managers that close/shutdown automatically (see with cluster.open_ioctx('mypool') as ioctx: rbd_inst = rbd.RBD() size = 4 * 1024 * 1024 # 4 GiB - rbd_inst.create('myimage', 4) - with rbd.Image('myimage') is image: + rbd_inst.create(ioctx, 'myimage', 4) + with rbd.Image(ioctx, 'myimage') as image: data = 'foo' * 200 image.write(data, 0) -- 2.39.5