congressclient.common.utils.
env
(*vars, **kwargs)¶Search for the first defined of possibly many env vars
Returns the first environment variable defined in vars, or returns the default defined in kwargs.
congressclient.common.utils.
format_dict
(data)¶Return a formatted string.
data – a dict
a string formatted to {a:b, c:d}
congressclient.common.utils.
format_list
(data)¶Return a formatted strings
data – a list of strings
a string formatted to a,b,c
congressclient.common.utils.
format_long_dict_list
(data)¶Return a formatted string.
data – a list of dicts
a string formatted to {a:b, c:d}, {e:f, g:h}
congressclient.common.utils.
get_client_class
(api_name, version, version_map)¶Returns the client class for the requested API version
api_name – the name of the API, e.g. ‘compute’, ‘image’, etc
version – the requested API version
version_map – a dict of client classes keyed by version
a client class for the requested API version
congressclient.common.utils.
get_dict_properties
(item, fields, mixed_case_fields=[], formatters={})¶Return a tuple containing the item properties.
item – a single dict resource
fields – tuple of strings with the desired field names
mixed_case_fields – tuple of field names to preserve case
formatters – dictionary mapping field names to callables to format the values
congressclient.common.utils.
get_resource_id_from_name
(name, results)¶congressclient.common.utils.
import_class
(import_str)¶Returns a class from a string including module and class
import_str – a string representation of the class name
the requested class
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.