Skip to content

Commit

Permalink
doc: fix sizes in librbd python examples
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Durgin <[email protected]>
  • Loading branch information
jdurgin committed May 17, 2012
1 parent a5dd387 commit 572c756
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/api/librbdpy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Then you instantiate an :class:rbd.RBD object, which you use to create the
image::

rbd_inst = rbd.RBD()
size = 4 * 1024 * 1024 # 4 GiB
rbd_inst.create(ioctx, 'myimage', 4)
size = 4 * 1024**3 # 4 GiB
rbd_inst.create(ioctx, 'myimage', size)

To perform I/O on the image, you instantiate an :class:rbd.Image object::

Expand All @@ -48,8 +48,8 @@ block::
ioctx = cluster.open_ioctx('my_pool')
try:
rbd_inst = rbd.RBD()
size = 4 * 1024 * 1024 # 4 GiB
rbd_inst.create(ioctx, 'myimage', 4)
size = 4 * 1024**3 # 4 GiB
rbd_inst.create(ioctx, 'myimage', size)
image = rbd.Image(ioctx, 'myimage')
try:
data = 'foo' * 200
Expand All @@ -68,8 +68,8 @@ classes can be used as context managers that close/shutdown automatically (see
with rados.Rados(conffile='my_ceph.conf') as cluster:
with cluster.open_ioctx('mypool') as ioctx:
rbd_inst = rbd.RBD()
size = 4 * 1024 * 1024 # 4 GiB
rbd_inst.create(ioctx, 'myimage', 4)
size = 4 * 1024**3 # 4 GiB
rbd_inst.create(ioctx, 'myimage', size)
with rbd.Image(ioctx, 'myimage') as image:
data = 'foo' * 200
image.write(data, 0)
Expand Down

0 comments on commit 572c756

Please sign in to comment.