def _linux_set_networking():
 vmware_tools_bin = None
 if os.path.exists('/usr/sbin/vmtoolsd'):
  vmware_tools_bin = '/usr/sbin/vmtoolsd'
 elif os.path.exists('/usr/bin/vmtoolsd'):
  vmware_tools_bin = '/usr/bin/vmtoolsd'
 elif os.path.exists('/usr/sbin/vmware-guestd'):
  vmware_tools_bin = '/usr/sbin/vmware-guestd'
 elif os.path.exists('/usr/bin/vmware-guestd'):
  vmware_tools_bin = '/usr/bin/vmware-guestd'
 if vmware_tools_bin:
  cmd = [vmware_tools_bin, '--cmd', 'machine.id.get']
  network_details = _parse_network_details(_execute(cmd, check_exit_code=False))
  if (platform.dist()[0] == 'Ubuntu'):
   _set_ubuntu_networking(network_details)
  elif (platform.dist()[0] == 'redhat'):
   _set_rhel_networking(network_details)
  else:
   logging.warn((_("Distro '%s' not supported") % platform.dist()[0]))
 else:
  logging.warn(_('VMware Tools is not installed'))

def _linux_set_networking ( ) : vmware_tools_bin = None if os . path . exists ( '/usr/sbin/vmtoolsd' ) : vmware_tools_bin = '/usr/sbin/vmtoolsd' elif os . path . exists ( '/usr/bin/vmtoolsd' ) : vmware_tools_bin = '/usr/bin/vmtoolsd' elif os . path . exists ( '/usr/sbin/vmware-guestd' ) : vmware_tools_bin = '/usr/sbin/vmware-guestd' elif os . path . exists ( '/usr/bin/vmware-guestd' ) : vmware_tools_bin = '/usr/bin/vmware-guestd' if vmware_tools_bin : cmd = [ vmware_tools_bin , '--cmd' , 'machine.id.get' ] network_details = _parse_network_details ( _execute ( cmd , check_exit_code = False ) ) if ( platform . dist ( ) [ 0 ] == 'Ubuntu' ) : _set_ubuntu_networking ( network_details ) elif ( platform . dist ( ) [ 0 ] == 'redhat' ) : _set_rhel_networking ( network_details ) else : logging . warn ( ( _ ( "Distro '%s' not supported" ) % platform . dist ( ) [ 0 ] ) ) else : logging . warn ( _ ( 'VMware Tools is not installed' ) )
set ip address for the linux vm .