I put in doc/rados/api/python.rst line numbers on every code samples in
order to make them look all the same.
Fixes: #12174
Signed off: Pierre Chaumont pierre.chaumont31@gmail.com
running Ceph cluster. To set one up quickly, see `Getting Started`_.
First, create a Python source file for your Ceph client. ::
-
+ :linenos:
+
sudo vim client.py
To use the ``rados.py`` module, import it into your source file.
.. code-block:: python
+ :linenos:
import rados
of the initial Ceph monitors.
.. code-block:: python
+ :linenos:
import rados, sys
``ceph-deploy``.
.. code-block:: ini
-
+ :linenos:
+
[global]
...
keyring=/path/to/keyring/ceph.client.admin.keyring
to use.
.. code-block:: python
+ :linenos:
ioctx = cluster.open_ioctx('data')
that you close the connection. For example:
.. code-block:: python
+ :linenos:
print "\nClosing the connection."
ioctx.close()