def get_profiles(hypervisor=None):
 ret = {}
 if hypervisor:
  hypervisor = hypervisor
 else:
  hypervisor = __salt__['config.get']('libvirt:hypervisor', VIRT_DEFAULT_HYPER)
 virtconf = __salt__['config.get']('virt', {})
 for typ in ['disk', 'nic']:
  _func = getattr(sys.modules[__name__], '_{0}_profile'.format(typ))
  ret[typ] = {'default': _func('default', hypervisor)}
  if (typ in virtconf):
   ret.setdefault(typ, {})
   for prf in virtconf[typ]:
    ret[typ][prf] = _func(prf, hypervisor)
 return ret

def get_profiles ( hypervisor = None ) : ret = { } if hypervisor : hypervisor = hypervisor else : hypervisor = __salt__ [ 'config.get' ] ( 'libvirt:hypervisor' , VIRT_DEFAULT_HYPER ) virtconf = __salt__ [ 'config.get' ] ( 'virt' , { } ) for typ in [ 'disk' , 'nic' ] : _func = getattr ( sys . modules [ __name__ ] , '_{0}_profile' . format ( typ ) ) ret [ typ ] = { 'default' : _func ( 'default' , hypervisor ) } if ( typ in virtconf ) : ret . setdefault ( typ , { } ) for prf in virtconf [ typ ] : ret [ typ ] [ prf ] = _func ( prf , hypervisor ) return ret
get profiles .