Go ahead and admit that we return Munch objects

There was a point in time in the past where we were gung ho on using
Munch as a halfway house to get us to pure dicts. However, we released
1.0 before we could do that, so we're pretty stuck with them for the
forseeable future. That's not terrible - they're pretty low overhead and
work pretty well.

Depends-On: Ie10099430481ffa76f5a19557e3693189544df6b
Change-Id: I8b7dd2c4038db999280ec0c2c9c43fb9499e6d22
This commit is contained in:
Monty Taylor 2016-02-21 13:30:43 -08:00
parent 9f4805bedb
commit 9cdd967550
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
4 changed files with 103 additions and 109 deletions

View File

@ -68,12 +68,10 @@ Returned Resources
Complex objects returned to the caller must be a dict type. The
methods `obj_to_dict()` or `obj_list_to_dict()` should be used for this.
As of this writing, those two methods are returning Bunch objects, which help
As of this writing, those two methods are returning Munch objects, which help
to maintain backward compatibility with a time when shade returned raw
objects. Bunch allows the returned resource to act as *both* an object
and a dict. Use of Bunch objects will eventually be deprecated in favor
of just pure dicts, so do not depend on the Bunch object functionality.
Expect a pure dict type.
objects. Munch allows the returned resource to act as *both* an object
and a dict.
Nova vs. Neutron
================

View File

@ -8,16 +8,10 @@ To use shade in a project::
.. note::
API methods that return a description of an OpenStack resource (e.g.,
server instance, image, volume, etc.) do so using a dictionary of values
(e.g., ``server['id']``, ``image['name']``). This is the standard, and
**recommended**, way to access these resource values.
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.
server instance, image, volume, etc.) do so using a `munch.Munch` object
from the `Munch library <https://github.com/Infinidat/munch>`_. `Munch`
objects can be accessed using either dictionary or object notation
(e.g., ``server.id``, ``image.name`` and ``server['id']``, ``image['name']``)
.. autoclass:: shade.OpenStackCloud
:members:

View File

@ -455,7 +455,7 @@ class OpenStackCloud(object):
:param string domain_id: domain id to scope the listed projects.
:returns: a list of dicts containing the project description.
:returns: a list of ``munch.Munch`` containing the project description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -479,7 +479,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use.
:param domain_id: domain id to scope the searched projects.
:returns: a list of dict containing the projects
:returns: a list of ``munch.Munch`` containing the projects
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -494,7 +494,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use.
:param domain_id: domain id (keystone v3 only)
:returns: a list of dicts containing the project description.
:returns: a list of ``munch.Munch`` containing the project description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -577,7 +577,7 @@ class OpenStackCloud(object):
def list_users(self):
"""List Keystone Users.
:returns: a list of dicts containing the user description.
:returns: a list of ``munch.Munch`` containing the user description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -592,7 +592,7 @@ class OpenStackCloud(object):
:param string name: user name or id.
:param dict filters: a dict containing additional filters to use.
:returns: a list of dict containing the users
:returns: a list of ``munch.Munch`` containing the users
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -606,7 +606,7 @@ class OpenStackCloud(object):
:param string name_or_id: user name or id.
:param dict filters: a dict containing additional filters to use.
:returns: a single dict containing the user description.
:returns: a single ``munch.Munch`` containing the user description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -619,7 +619,7 @@ class OpenStackCloud(object):
:param string user_id: user ID
:param bool normalize: Flag to control dict normalization
:returns: a single dict containing the user description
:returns: a single ``munch.Munch`` containing the user description
"""
with _utils.shade_exceptions(
"Error getting user with ID {user_id}".format(
@ -1140,7 +1140,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use. e.g.
{'router:external': True}
:returns: a list of dicts containing the network description.
:returns: a list of ``munch.Munch`` containing the network description.
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -1155,7 +1155,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use. e.g.
{'admin_state_up': True}
:returns: a list of dicts containing the router description.
:returns: a list of ``munch.Munch`` containing the router description.
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -1170,7 +1170,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use. e.g.
{'enable_dhcp': True}
:returns: a list of dicts containing the subnet description.
:returns: a list of ``munch.Munch`` containing the subnet description.
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -1185,7 +1185,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use. e.g.
{'device_id': '2711c67a-b4a7-43dd-ace7-6187b791c3f0'}
:returns: a list of dicts containing the port description.
:returns: a list of ``munch.Munch`` containing the port description.
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -1261,7 +1261,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use. e.g.
{'stack_status': 'CREATE_COMPLETE'}
:returns: a list of dict containing the stack description.
:returns: a list of ``munch.Munch`` containing the stack description.
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -1272,7 +1272,7 @@ class OpenStackCloud(object):
def list_keypairs(self):
"""List all available keypairs.
:returns: A list of keypair dicts.
:returns: A list of ``munch.Munch`` containing keypair info.
"""
with _utils.shade_exceptions("Error fetching keypair list"):
@ -1282,7 +1282,7 @@ class OpenStackCloud(object):
"""List all available networks.
:param filters: (optional) dict of filter conditions to push down
:returns: A list of network dicts.
:returns: A list of ``munch.Munc`` containing network info.
"""
# Translate None from search interface to empty {} for kwargs below
@ -1296,7 +1296,7 @@ class OpenStackCloud(object):
"""List all available routers.
:param filters: (optional) dict of filter conditions to push down
:returns: A list of router dicts.
:returns: A list of router ``munch.Munch``.
"""
# Translate None from search interface to empty {} for kwargs below
@ -1310,7 +1310,7 @@ class OpenStackCloud(object):
"""List all available subnets.
:param filters: (optional) dict of filter conditions to push down
:returns: A list of subnet dicts.
:returns: A list of subnet ``munch.Munch``.
"""
# Translate None from search interface to empty {} for kwargs below
@ -1324,7 +1324,7 @@ class OpenStackCloud(object):
"""List all available ports.
:param filters: (optional) dict of filter conditions to push down
:returns: A list of port dicts.
:returns: A list of port ``munch.Munch``.
"""
# If pushdown filters are specified, bypass local caching.
@ -1356,7 +1356,7 @@ class OpenStackCloud(object):
def list_volumes(self, cache=True):
"""List all available volumes.
:returns: A list of volume dicts.
:returns: A list of volume ``munch.Munch``.
"""
if not cache:
@ -1370,7 +1370,7 @@ class OpenStackCloud(object):
def list_flavors(self, get_extra=True):
"""List all available flavors.
:returns: A list of flavor dicts.
:returns: A list of flavor ``munch.Munch``.
"""
with _utils.shade_exceptions("Error fetching flavor list"):
@ -1398,7 +1398,7 @@ class OpenStackCloud(object):
def list_stacks(self):
"""List all Heat stacks.
:returns: a list of dict containing the stack description.
:returns: a list of ``munch.Munch`` containing the stack description.
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -1410,7 +1410,7 @@ class OpenStackCloud(object):
def list_server_security_groups(self, server):
"""List all security groups associated with the given server.
:returns: A list of security group dicts.
:returns: A list of security group ``munch.Munch``.
"""
# Don't even try if we're a cloud that doesn't have them
@ -1426,7 +1426,7 @@ class OpenStackCloud(object):
def list_security_groups(self):
"""List all available security groups.
:returns: A list of security group dicts.
:returns: A list of security group ``munch.Munch``.
"""
# Handle neutron security groups
@ -1453,7 +1453,7 @@ class OpenStackCloud(object):
def list_servers(self, detailed=False):
"""List all available servers.
:returns: A list of server dicts.
:returns: A list of server ``munch.Munch``.
"""
if (time.time() - self._servers_time) >= self._SERVER_AGE:
@ -1542,7 +1542,7 @@ class OpenStackCloud(object):
def list_floating_ip_pools(self):
"""List all available floating IP pools.
:returns: A list of floating IP pool dicts.
:returns: A list of floating IP pool ``munch.Munch``.
"""
if not self._has_nova_extension('os-floating-ip-pools'):
@ -1555,7 +1555,7 @@ class OpenStackCloud(object):
def list_floating_ips(self):
"""List all available floating IPs.
:returns: A list of floating IP dicts.
:returns: A list of floating IP ``munch.Munch``.
"""
if self._use_neutron_floating():
@ -1759,7 +1759,7 @@ class OpenStackCloud(object):
def get_external_networks(self):
"""Return the networks that are configured to route northbound.
:returns: A list of network dicts if one is found
:returns: A list of network ``munch.Munch`` if one is found
"""
self._find_interesting_networks()
return self._external_networks
@ -1767,7 +1767,7 @@ class OpenStackCloud(object):
def get_internal_networks(self):
"""Return the networks that are configured to not route northbound.
:returns: A list of network dicts if one is found
:returns: A list of network ``munch.Munch`` if one is found
"""
self._find_interesting_networks()
return self._internal_networks
@ -1791,7 +1791,7 @@ class OpenStackCloud(object):
}
}
:returns: A keypair dict or None if no matching keypair is
:returns: A keypair ``munch.Munch`` or None if no matching keypair is
found.
"""
@ -1812,7 +1812,7 @@ class OpenStackCloud(object):
}
}
:returns: A network dict or None if no matching network is
:returns: A network ``munch.Munch`` or None if no matching network is
found.
"""
@ -1833,7 +1833,7 @@ class OpenStackCloud(object):
}
}
:returns: A router dict or None if no matching router is
:returns: A router ``munch.Munch`` or None if no matching router is
found.
"""
@ -1854,7 +1854,7 @@ class OpenStackCloud(object):
}
}
:returns: A subnet dict or None if no matching subnet is
:returns: A subnet ``munch.Munch`` or None if no matching subnet is
found.
"""
@ -1875,7 +1875,7 @@ class OpenStackCloud(object):
}
}
:returns: A port dict or None if no matching port is found.
:returns: A port ``munch.Munch`` or None if no matching port is found.
"""
return _utils._get_entity(self.search_ports, name_or_id, filters)
@ -1895,7 +1895,7 @@ class OpenStackCloud(object):
}
}
:returns: A volume dict or None if no matching volume is
:returns: A volume ``munch.Munch`` or None if no matching volume is
found.
"""
@ -1916,7 +1916,7 @@ class OpenStackCloud(object):
}
}
:returns: A flavor dict or None if no matching flavor is
:returns: A flavor ``munch.Munch`` or None if no matching flavor is
found.
"""
@ -1937,7 +1937,7 @@ class OpenStackCloud(object):
}
}
:returns: A security group dict or None if no matching
:returns: A security group ``munch.Munch`` or None if no matching
security group is found.
"""
@ -1959,7 +1959,7 @@ class OpenStackCloud(object):
}
}
:returns: A server dict or None if no matching server is
:returns: A server ``munch.Munch`` or None if no matching server is
found.
"""
@ -2006,7 +2006,8 @@ class OpenStackCloud(object):
}
}
:returns: An image dict or None if no matching image is found.
:returns: An image ``munch.Munch`` or None if no matching image
is found
"""
return _utils._get_entity(self.search_images, name_or_id, filters)
@ -2066,7 +2067,7 @@ class OpenStackCloud(object):
}
}
:returns: A floating IP dict or None if no matching floating
:returns: A floating IP ``munch.Munch`` or None if no matching floating
IP is found.
"""
@ -2079,7 +2080,7 @@ class OpenStackCloud(object):
:param filters: a dict containing additional filters to use. e.g.
{'stack_status': 'CREATE_COMPLETE'}
:returns: a dict containing the stack description
:returns: a ``munch.Munch`` containing the stack description
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call or if multiple matches are found.
@ -2241,8 +2242,8 @@ class OpenStackCloud(object):
:param string subnet_id: The ID of the subnet to use for the interface
:param string port_id: The ID of the port to use for the interface
:returns: A dict with the router id (id), subnet ID (subnet_id),
port ID (port_id) and tenant ID (tenant_id).
:returns: A ``munch.Munch`` with the router id (id),
subnet ID (subnet_id), port ID (port_id) and tenant ID (tenant_id).
:raises: OpenStackCloudException on operation error.
"""
@ -2295,7 +2296,7 @@ class OpenStackCloud(object):
Controls whether all, internal interfaces or external interfaces
are returned.
:returns: A list of port dict objects.
:returns: A list of port ``munch.Munch`` objects.
"""
ports = self.search_ports(filters={'device_id': router['id']})
@ -3148,7 +3149,7 @@ class OpenStackCloud(object):
}
}
:returns: A volume dict or None if no matching volume is
:returns: A volume ``munch.Munch`` or None if no matching volume is
found.
"""
@ -3158,7 +3159,7 @@ class OpenStackCloud(object):
def list_volume_snapshots(self, detailed=True, search_opts=None):
"""List all volume snapshots.
:returns: A list of volume snapshots dicts.
:returns: A list of volume snapshots ``munch.Munch``.
"""
with _utils.shade_exceptions("Error getting a list of snapshots"):
@ -3612,7 +3613,7 @@ class OpenStackCloud(object):
:param skip_attach: (optional) Skip the actual attach and just do
the wait. Defaults to False.
:returns: The server dict
:returns: The server ``munch.Munch``
:raises: OpenStackCloudException, on operation error.
"""
@ -3860,7 +3861,7 @@ class OpenStackCloud(object):
:param nat_destination: (optional) the name of the network of the
port to associate with the floating ip.
:returns: the update server dict
:returns: the updated server ``munch.Munch``
"""
if reuse:
f_ip = self.available_floating_ip(network=network)
@ -3894,7 +3895,7 @@ class OpenStackCloud(object):
:param fixed_address: (optional) Fixed address of the server to
attach the IP to
:returns: The updated server dict
:returns: The updated server ``munch.Munch``
:raises: ``OpenStackCloudException``, on operation error.
"""
@ -4160,7 +4161,7 @@ class OpenStackCloud(object):
be attached to, if it's not possible to
infer from the cloud's configuration.
(Optional, defaults to None)
:returns: A dict representing the created server.
:returns: A ``munch.Munch`` representing the created server.
:raises: OpenStackCloudException on operation error.
"""
# nova cli calls this boot_volume. Let's be the same
@ -5114,7 +5115,7 @@ class OpenStackCloud(object):
:param device_id: The ID of the device that uses this port.
For example, a virtual server. (Optional)
:returns: a dictionary describing the created port.
:returns: a ``munch.Munch`` describing the created port.
:raises: ``OpenStackCloudException`` on operation error.
"""
@ -5173,7 +5174,7 @@ class OpenStackCloud(object):
:param device_owner: The ID of the entity that uses this port.
For example, a DHCP agent. (Optional)
:returns: a dictionary describing the updated port.
:returns: a ``munch.Munch`` describing the updated port.
:raises: OpenStackCloudException on operation error.
"""
@ -5213,7 +5214,7 @@ class OpenStackCloud(object):
:param string name: A name for the security group.
:param string description: Describes the security group.
:returns: A dict representing the new security group.
:returns: A ``munch.Munch`` representing the new security group.
:raises: OpenStackCloudException on operation error.
:raises: OpenStackCloudUnavailableFeature if security groups are
@ -5297,7 +5298,7 @@ class OpenStackCloud(object):
:param string name: New name for the security group.
:param string description: New description for the security group.
:returns: A dictionary describing the updated security group.
:returns: A ``munch.Munch`` describing the updated security group.
:raises: OpenStackCloudException on operation error.
"""
@ -5380,7 +5381,7 @@ class OpenStackCloud(object):
Must be IPv4 or IPv6, and addresses represented in CIDR must
match the ingress or egress rules.
:returns: A dict representing the new security group rule.
:returns: A ``munch.Munch`` representing the new security group rule.
:raises: OpenStackCloudException on operation error.
"""

View File

@ -85,8 +85,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param name_or_id: A node name or UUID that will be looked up.
:returns: Dictonary representing the node found or None if no nodes
are found.
:returns: ``munch.Munch`` representing the node found or None if no
nodes are found.
"""
try:
return self.manager.submitTask(
@ -99,7 +99,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param mac: Port MAC address to query in order to return a node.
:returns: Dictonary representing the node found or None
:returns: ``munch.Munch`` representing the node found or None
if the node is not found.
"""
try:
@ -125,7 +125,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param timeout: Integer value, defautling to 3600 seconds, for the$
wait state to reach completion.
:returns: Dictonary representing the current state of the machine
:returns: ``munch.Munch`` representing the current state of the machine
upon exit of the method.
"""
@ -217,7 +217,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:raises: OpenStackCloudException on operation error.
:returns: Returns a dictonary representing the new
:returns: Returns a ``munch.Munch`` representing the new
baremetal node.
"""
with _utils.shade_exceptions("Error registering machine with Ironic"):
@ -394,7 +394,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:raises: OpenStackCloudException on operation error.
:returns: Dictonary representing the newly updated node.
:returns: ``munch.Munch`` representing the newly updated node.
"""
with _utils.shade_exceptions(
@ -438,7 +438,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:raises: OpenStackCloudException on operation error.
:returns: Dictonary containing a machine sub-dictonary consisting
:returns: ``munch.Munch`` containing a machine sub-dictonary consisting
of the updated data returned from the API update operation,
and a list named changes which contains all of the API paths
that received updates.
@ -556,7 +556,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:raises: OpenStackCloudException on operation error.
:returns: Dictonary representing the current state of the machine
:returns: ``munch.Munch`` representing the current state of the machine
upon exit of the method.
"""
with _utils.shade_exceptions(
@ -757,8 +757,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param description: Service description (optional).
:param enabled: Whether the service is enabled (v3 only)
:returns: a dict containing the services description, i.e. the
following attributes::
:returns: a ``munch.Munch`` containing the services description,
i.e. the following attributes::
- id: <service id>
- name: <service name>
- type: <service type>
@ -816,7 +816,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
def list_services(self):
"""List all Keystone services.
:returns: a list of dict containing the services description.
:returns: a list of ``munch.Munch`` containing the services description
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -832,7 +832,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param filters: a dict containing additional filters to use. e.g.
{'type': 'network'}.
:returns: a list of dict containing the services description.
:returns: a list of ``munch.Munch`` containing the services description
:raises: ``OpenStackCloudException`` if something goes wrong during the
openstack API call.
@ -847,8 +847,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param filters: a dict containing additional filters to use. e.g.
{'type': 'network'}
:returns: a dict containing the services description, i.e. the
following attributes::
:returns: a ``munch.Munch`` containing the services description,
i.e. the following attributes::
- id: <service id>
- name: <service name>
- type: <service type>
@ -902,7 +902,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
(url, interface) calling semantics are supported. But
you can only use one of them at a time.
:returns: a list of dicts containing the endpoint description.
:returns: a list of ``munch.Munch`` containing the endpoint description
:raises: OpenStackCloudException if the service cannot be found or if
something goes wrong during the openstack API call.
@ -983,7 +983,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
def list_endpoints(self):
"""List Keystone endpoints.
:returns: a list of dict containing the endpoint description.
:returns: a list of ``munch.Munch`` containing the endpoint description
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1001,8 +1001,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param filters: a dict containing additional filters to use. e.g.
{'region': 'region-a.geo-1'}
:returns: a list of dict containing the endpoint description. Each dict
contains the following attributes::
:returns: a list of ``munch.Munch`` containing the endpoint
description. Each dict contains the following attributes::
- id: <endpoint id>
- region: <endpoint region>
- public_url: <endpoint public url>
@ -1022,8 +1022,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param filters: a dict containing additional filters to use. e.g.
{'region': 'region-a.geo-1'}
:returns: a dict containing the endpoint description. i.e. a dict
containing the following attributes::
:returns: a ``munch.Munch`` containing the endpoint description.
i.e. a ``munch.Munch`` containing the following attributes::
- id: <endpoint id>
- region: <endpoint region>
- public_url: <endpoint public url>
@ -1066,7 +1066,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param description: A description of the domain.
:param enabled: Is the domain enabled or not (default True).
:returns: a dict containing the domain description
:returns: a ``munch.Munch`` containing the domain description
:raise OpenStackCloudException: if the domain cannot be created
"""
@ -1135,7 +1135,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
def list_domains(self):
"""List Keystone domains.
:returns: a list of dicts containing the domain description.
:returns: a list of ``munch.Munch`` containing the domain description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1151,8 +1151,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param dict filters: A dict containing additional filters to use.
Keys to search on are id, name, enabled and description.
:returns: a list of dicts containing the domain description. Each dict
contains the following attributes::
:returns: a list of ``munch.Munch`` containing the domain description.
Each ``munch.Munch`` contains the following attributes::
- id: <domain id>
- name: <domain name>
- description: <domain description>
@ -1179,8 +1179,9 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param dict filters: A dict containing additional filters to use.
Keys to search on are id, name, enabled and description.
:returns: a dict containing the domain description, or None if not
found. Each dict contains the following attributes::
:returns: a ``munch.Munch`` containing the domain description, or None
if not found. Each ``munch.Munch`` contains the following
attributes::
- id: <domain id>
- name: <domain name>
- description: <domain description>
@ -1203,7 +1204,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
def list_groups(self):
"""List Keystone Groups.
:returns: A list of dicts containing the group description.
:returns: A list of ``munch.Munch`` containing the group description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1218,7 +1219,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param name: Group name or id.
:param filters: A dict containing additional filters to use.
:returns: A list of dict containing the group description.
:returns: A list of ``munch.Munch`` containing the group description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1232,7 +1233,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param id: Group name or id.
:param filters: A dict containing additional filters to use.
:returns: A dict containing the group description.
:returns: A ``munch.Munch`` containing the group description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1246,7 +1247,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param string description: Group description.
:param string domain: Domain name or ID for the group.
:returns: A dict containing the group description.
:returns: A ``munch.Munch`` containing the group description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1276,7 +1277,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param string name: New group name.
:param string description: New group description.
:returns: A dict containing the group description.
:returns: A ``munch.Munch`` containing the group description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1324,7 +1325,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
def list_roles(self):
"""List Keystone roles.
:returns: a list of dicts containing the role description.
:returns: a list of ``munch.Munch`` containing the role description.
:raises: ``OpenStackCloudException``: if something goes wrong during
the openstack API call.
@ -1340,8 +1341,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param string name: role name or id.
:param dict filters: a dict containing additional filters to use.
:returns: a list of dict containing the role description. Each dict
contains the following attributes::
:returns: a list of ``munch.Munch`` containing the role description.
Each ``munch.Munch`` contains the following attributes::
- id: <role id>
- name: <role name>
@ -1359,8 +1360,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param id: role name or id.
:param filters: a dict containing additional filters to use.
:returns: a single dict containing the role description. Each dict
contains the following attributes::
:returns: a single ``munch.Munch`` containing the role description.
Each ``munch.Munch`` contains the following attributes::
- id: <role id>
- name: <role name>
@ -1417,8 +1418,8 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
NOTE: For keystone v2, only user, project, and role are used.
Project and user are both required in filters.
:returns: a list of dicts containing the role assignment description.
Contains the following attributes::
:returns: a list of ``munch.Munch`` containing the role assignment
description. Contains the following attributes::
- id: <role id>
- user|group: <user or group id>
@ -1457,7 +1458,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param rxtx_factor: RX/TX factor
:param is_public: Make flavor accessible to the public
:returns: A dict describing the new flavor.
:returns: A ``munch.Munch`` describing the new flavor.
:raises: OpenStackCloudException on operation error.
"""
@ -1571,7 +1572,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
:param string name: The name of the role.
:returns: a dict containing the role description
:returns: a ``munch.Munch`` containing the role description
:raise OpenStackCloudException: if the role cannot be created
"""
@ -1761,7 +1762,7 @@ class OperatorCloud(openstackcloud.OpenStackCloud):
def list_hypervisors(self):
"""List all hypervisors
:returns: A list of hypervisor dicts.
:returns: A list of hypervisor ``munch.Munch``.
"""
with _utils.shade_exceptions("Error fetching hypervisor list"):