Returns a list of devices, keeping only a brief listing.
    CLI Example:
    .. code-block:: bash
        salt-cloud -Q
        salt-cloud --query
        salt-cloud -f list_nodes packet-provider
    ..

def list_nodes(call=None):
    '''
    Returns a list of devices, keeping only a brief listing.
    CLI Example:
    .. code-block:: bash
        salt-cloud -Q
        salt-cloud --query
        salt-cloud -f list_nodes packet-provider
    ..
    '''

    if call == 'action':
        raise SaltCloudException(
            'The list_nodes function must be called with -f or --function.'
        )

    ret = {}

    for device in get_devices_by_token():
        ret[device.hostname] = device.__dict__

    return ret