def list(host=None, quiet=False, hyper=None):  # pylint: disable=redefined-builtin
    '''
    List the virtual machines on each host, this is a simplified query,
    showing only the virtual machine names belonging to each host.
    A single host can be passed in to specify an individual host
    to list.
    '''
    if quiet:
        log.warning("'quiet' is deprecated. Please migrate to --quiet")
    ret = {}
    client = salt.client.get_local_client(__opts__['conf_file'])
    for info in client.cmd_iter('virtual:physical',
                                'virt.vm_info', tgt_type='grain'):
        if not info:
            continue
        if not isinstance(info, dict):
            continue
        chunk = {}
        id_ = next(six.iterkeys(info))
        if host:
            if host != id_:
                continue
        if not isinstance(info[id_], dict):
            continue
        if 'ret' not in info[id_]:
            continue
        if not isinstance(info[id_]['ret'], dict):
            continue
        data = {}
        for key, val in six.iteritems(info[id_]['ret']):
            if val['state'] in data:
                data[val['state']].append(key)
            else:
                data[val['state']] = [key]
        chunk[id_] = data
        ret.update(chunk)
        if not quiet:
            __jid_event__.fire_event({'data': chunk, 'outputter': 'nested'}, 'progress')

    return ret
def list ( host = None , quiet = False , hyper = None ) : if quiet : log . warning ( "'quiet' is deprecated. Please migrate to --quiet" ) ret = { } client = salt . client . get_local_client ( __opts__ [ 'conf_file' ] ) for info in client . cmd_iter ( 'virtual:physical' , 'virt.vm_info' , tgt_type = 'grain' ) : if not info : continue if not isinstance ( info , dict ) : continue chunk = { } id_ = next ( six . iterkeys ( info ) ) if host : if host != id_ : continue if not isinstance ( info [ id_ ] , dict ) : continue if 'ret' not in info [ id_ ] : continue if not isinstance ( info [ id_ ] [ 'ret' ] , dict ) : continue data = { } for key , val in six . iteritems ( info [ id_ ] [ 'ret' ] ) : if val [ 'state' ] in data : data [ val [ 'state' ] ] . append ( key ) else : data [ val [ 'state' ] ] = [ key ] chunk [ id_ ] = data ret . update ( chunk ) if not quiet : __jid_event__ . fire_event ( { 'data' : chunk , 'outputter' : 'nested' } , 'progress' ) return ret
List the virtual machines on each host, this is a simplified query,
    showing only the virtual machine names belonging to each host.
    A single host can be passed in to specify an individual host
    to list.