Clarify Munch object usage in documentation

We have pretty much settled on sticking with Munch objects for the
1.x series of shade releases. Change the documentation to note this.

Change-Id: I8b2838c3a5a40b0c74e31081bfb1ed4b0d39280f
This commit is contained in:
David Shrewsbury 2016-02-05 14:11:09 -05:00
parent df379be704
commit ab8a196907

View File

@ -6,12 +6,18 @@ To use shade in a project::
import shade import shade
.. warning:: .. note::
Several of the API methods return a ``dict`` that describe a resource. API methods that return a description of an OpenStack resource (e.g.,
It is possible to access keys of the dict as an attribute (e.g., server instance, image, volume, etc.) do so using a dictionary of values
``server.id`` instead of ``server['id']``) to maintain some backward (e.g., ``server['id']``, ``image['name']``). This is the standard, and
compatibility, but attribute access is deprecated. New code should **recommended**, way to access these resource values.
assume a normal dictionary and access values via key.
For backward compatibility, resource values can be accessed using object
attribute access (e.g., ``server.id``, ``image.name``). Shade uses the
`Munch library <https://github.com/Infinidat/munch>`_ to provide this
behavior. This is **NOT** the recommended way to access resource values.
We keep this behavior for developer convenience in the 1.x series of shade
releases. This will likely not be the case in future, major releases of shade.
.. autoclass:: shade.OpenStackCloud .. autoclass:: shade.OpenStackCloud
:members: :members: