def is_kvm_hyper():
 try:
  with salt.utils.fopen('/proc/modules') as fp_:
   if ('kvm_' not in fp_.read()):
    return False
 except IOError:
  return False
 return ('libvirtd' in __salt__['cmd.run'](__grains__['ps']))

def is_kvm_hyper ( ) : try : with salt . utils . fopen ( '/proc/modules' ) as fp_ : if ( 'kvm_' not in fp_ . read ( ) ) : return False except IOError : return False return ( 'libvirtd' in __salt__ [ 'cmd.run' ] ( __grains__ [ 'ps' ] ) )
returns a bool whether or not this node is a kvm hypervisor cli example: .