def _find_vm(name, data, quiet=False):
 for hv_ in data:
  if (not isinstance(data[hv_], dict)):
   continue
  if (name in data[hv_].get('vm_info', {})):
   ret = {hv_: {name: data[hv_]['vm_info'][name]}}
   if (not quiet):
    __jid_event__.fire_event({'data': ret, 'outputter': 'nested'}, 'progress')
   return ret
 return {}

def _find_vm ( name , data , quiet = False ) : for hv_ in data : if ( not isinstance ( data [ hv_ ] , dict ) ) : continue if ( name in data [ hv_ ] . get ( 'vm_info' , { } ) ) : ret = { hv_ : { name : data [ hv_ ] [ 'vm_info' ] [ name ] } } if ( not quiet ) : __jid_event__ . fire_event ( { 'data' : ret , 'outputter' : 'nested' } , 'progress' ) return ret return { }
scan the query data for the named vm .