src/lsi/utils/hosts.py
def get_entries(latest, filters, exclude, limit=None):
    """
    Lists all available instances.

    :param latest: If true, ignores the cache and grabs the latest list.
    :type latest: ``bool``
    :param filters: Filters to apply to results. A result will only be shown
                    if it includes all text in all filters.
    :type filters: [``str``]
    :param exclude: The opposite of filters. Results will be rejected if they
                    include any of these strings.
    :type exclude: [``str``]
    :param limit: Maximum number of entries to show (default no maximum).
    :type limit: ``int`` or ``NoneType``

    :return: A list of host entries.
    :rtype: ``list`` of :py:class:`HostEntry`
    """
    entry_list = _list_all_latest() if latest is True or not _is_valid_cache()\
                 else _list_all_cached()
    filtered = filter_entries(entry_list, filters, exclude)
    if limit is not None:
        return filtered[:limit]
    else:
        return filtered
def get_entries(latest, filters, exclude, limit=None):
    entry_list = _list_all_latest() if latest is True or not _is_valid_cache()\
                 else _list_all_cached()
    filtered = filter_entries(entry_list, filters, exclude)
    if limit is not None:
        return filtered[:limit]
    else:
        return filtered
def get_entries ( latest , filters , exclude , limit = None ) : entry_list = _list_all_latest ( ) if latest is True or not _is_valid_cache ( ) else _list_all_cached ( ) filtered = filter_entries ( entry_list , filters , exclude ) if limit is not None : return filtered [ : limit ] else : return filtered
Lists all available instances.

    :param latest: If true, ignores the cache and grabs the latest list.
    :type latest: ``bool``
    :param filters: Filters to apply to results. A result will only be shown
                    if it includes all text in all filters.
    :type filters: [``str``]
    :param exclude: The opposite of filters. Results will be rejected if they
                    include any of these strings.
    :type exclude: [``str``]
    :param limit: Maximum number of entries to show (default no maximum).
    :type limit: ``int`` or ``NoneType``

    :return: A list of host entries.
    :rtype: ``list`` of :py:class:`HostEntry`
Lists all available instances .