def _windows_virtual(osdata):
 grains = dict()
 if (osdata['kernel'] != 'Windows'):
  return grains
 manufacturer = osdata.get('manufacturer', '')
 if (manufacturer is None):
  manufacturer = ''
 productname = osdata.get('productname', '')
 if (productname is None):
  productname = ''
 if ('QEMU' in manufacturer):
  grains['virtual'] = 'kvm'
 if ('Bochs' in manufacturer):
  grains['virtual'] = 'kvm'
 elif ('oVirt' in productname):
  grains['virtual'] = 'kvm'
  grains['virtual_subtype'] = 'oVirt'
 elif ('RHEV Hypervisor' in productname):
  grains['virtual'] = 'kvm'
  grains['virtual_subtype'] = 'rhev'
 elif ('VirtualBox' in productname):
  grains['virtual'] = 'VirtualBox'
 elif ('VMware Virtual Platform' in productname):
  grains['virtual'] = 'VMware'
 elif (('Microsoft' in manufacturer) and ('Virtual Machine' in productname)):
  grains['virtual'] = 'VirtualPC'
 elif ('Parallels Software' in manufacturer):
  grains['virtual'] = 'Parallels'
 elif ('CloudStack KVM Hypervisor' in productname):
  grains['virtual'] = 'kvm'
  grains['virtual_subtype'] = 'cloudstack'
 return grains

def _windows_virtual ( osdata ) : grains = dict ( ) if ( osdata [ 'kernel' ] != 'Windows' ) : return grains manufacturer = osdata . get ( 'manufacturer' , '' ) if ( manufacturer is None ) : manufacturer = '' productname = osdata . get ( 'productname' , '' ) if ( productname is None ) : productname = '' if ( 'QEMU' in manufacturer ) : grains [ 'virtual' ] = 'kvm' if ( 'Bochs' in manufacturer ) : grains [ 'virtual' ] = 'kvm' elif ( 'oVirt' in productname ) : grains [ 'virtual' ] = 'kvm' grains [ 'virtual_subtype' ] = 'oVirt' elif ( 'RHEV Hypervisor' in productname ) : grains [ 'virtual' ] = 'kvm' grains [ 'virtual_subtype' ] = 'rhev' elif ( 'VirtualBox' in productname ) : grains [ 'virtual' ] = 'VirtualBox' elif ( 'VMware Virtual Platform' in productname ) : grains [ 'virtual' ] = 'VMware' elif ( ( 'Microsoft' in manufacturer ) and ( 'Virtual Machine' in productname ) ) : grains [ 'virtual' ] = 'VirtualPC' elif ( 'Parallels Software' in manufacturer ) : grains [ 'virtual' ] = 'Parallels' elif ( 'CloudStack KVM Hypervisor' in productname ) : grains [ 'virtual' ] = 'kvm' grains [ 'virtual_subtype' ] = 'cloudstack' return grains
returns what type of virtual hardware is under the hood .