def is_xen_hyper():
 try:
  if (__grains__['virtual_subtype'] != 'Xen Dom0'):
   return False
 except KeyError:
  return False
 try:
  with salt.utils.fopen('/proc/modules') as fp_:
   if ('xen_' not in fp_.read()):
    return False
 except (OSError, IOError):
  return False
 return ('libvirtd' in __salt__['cmd.run'](__grains__['ps']))

def is_xen_hyper ( ) : try : if ( __grains__ [ 'virtual_subtype' ] != 'Xen Dom0' ) : return False except KeyError : return False try : with salt . utils . fopen ( '/proc/modules' ) as fp_ : if ( 'xen_' not in fp_ . read ( ) ) : return False except ( OSError , IOError ) : return False return ( 'libvirtd' in __salt__ [ 'cmd.run' ] ( __grains__ [ 'ps' ] ) )
returns a bool whether or not this node is a xen hypervisor cli example: .