Skip to content

Commit

Permalink
Update documetation (canonical#314)
Browse files Browse the repository at this point in the history
1. containers.rst: Add a newline to ensure syntax of admonition will take effect.
2. image.rst:
  a) The default value of wait argument in create() is True. (refs image.py#L101)
  b) The first argument in create() is the binary data of the image. Therefore, image_data should be opened in 'rb' mode. Or you will get an error.
3. operations.rst: Correct typo.

Signed-off-by: e1ee1e11 <e1ee1e11e1ee@gmail.com>
  • Loading branch information
e1ee1e11 authored and lasizoillo committed Jul 13, 2018
1 parent 31abb26 commit 9377952
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/source/containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ A container object (returned by `get` or `all`) has the following methods:
To create a new snapshot, use `create` with a `name` argument. If you want
to capture the contents of RAM in the snapshot, you can use `stateful=True`.

.. note:: Your LXD requires a relatively recent version of CRIU for this.

.. code-block:: python
Expand Down
4 changes: 2 additions & 2 deletions doc/source/images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ methods:
And create through the following methods, there's also a copy method on an
image:

- `create(data, public=False, wait=False)` - Create a new image. The first
- `create(data, public=False, wait=True)` - Create a new image. The first
argument is the binary data of the image itself. If the image is public,
set `public` to `True`.
- `create_from_simplestreams(server, alias, public=False, auto_update=False, wait=False)` -
Expand Down Expand Up @@ -93,7 +93,7 @@ you may also want to `wait=True`.

.. code-block:: python
>>> image_data = open('an_image.tar.gz').read()
>>> image_data = open('an_image.tar.gz', 'rb').read()
>>> image = client.images.create(image_data, public=True, wait=True)
>>> image.fingerprint
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
2 changes: 1 addition & 1 deletion doc/source/operations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Manager methods

Operations can be queried through the following client manager methods:

- `get()` - Get a specific network, by its name.
- `get()` - Get a specific operation, by its id.
- `wait_for_operation()` - get an operation, but wait until it is complete
before returning the operation object.

Expand Down

0 comments on commit 9377952

Please sign in to comment.