The sushy.utils Module

The sushy.utils Module

sushy.utils.get_members_identities(members)

Extract and return a tuple of members identities

Parameters:members – A list of members in JSON format
Returns:A tuple containing the members paths
sushy.utils.get_sub_resource_path_by(resource, subresource_name)

Helper function to find the subresource path

Parameters:
  • resource – ResourceBase instance on which the name gets queried upon.
  • subresource_name – name of the resource field to fetch the @odata.id’ from.
sushy.utils.int_or_none(x)

Given a value x it cast as int or None

Parameters:x – The value to transform and return
Returns:Either None or x cast to an int
sushy.utils.revert_dictionary(dictionary)

Given a dictionary revert it’s mapping

Parameters:dictionary – A dictionary to be reverted
Returns:A dictionary with the keys and values reverted
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.