def _DisableNetworkManager(self, interfaces, logger):
    """Disable network manager management on a list of network interfaces.

    Args:
      interfaces: list of string, the output device names enable.
      logger: logger object, used to write to SysLog and serial port.
    """
    for interface in interfaces:
      interface_config = os.path.join(
          self.network_path, 'ifcfg-%s' % interface)
      if os.path.exists(interface_config):
        self._ModifyInterface(
            interface_config, 'DEVICE', interface, replace=False)
        self._ModifyInterface(
            interface_config, 'NM_CONTROLLED', 'no', replace=True)
      else:
        with open(interface_config, 'w') as interface_file:
          interface_content = [
              '# Added by Google.',
              'BOOTPROTO=none',
              'DEFROUTE=no',
              'DEVICE=%s' % interface,
              'IPV6INIT=no',
              'NM_CONTROLLED=no',
              'NOZEROCONF=yes',
              '',
          ]
          interface_file.write('\n'.join(interface_content))
        logger.info('Created config file for interface %s.', interface)
def _DisableNetworkManager ( self , interfaces , logger ) : for interface in interfaces : interface_config = os . path . join ( self . network_path , 'ifcfg-%s' % interface ) if os . path . exists ( interface_config ) : self . _ModifyInterface ( interface_config , 'DEVICE' , interface , replace = False ) self . _ModifyInterface ( interface_config , 'NM_CONTROLLED' , 'no' , replace = True ) else : with open ( interface_config , 'w' ) as interface_file : interface_content = [ '# Added by Google.' , 'BOOTPROTO=none' , 'DEFROUTE=no' , 'DEVICE=%s' % interface , 'IPV6INIT=no' , 'NM_CONTROLLED=no' , 'NOZEROCONF=yes' , '' , ] interface_file . write ( '\n' . join ( interface_content ) ) logger . info ( 'Created config file for interface %s.' , interface )
Disable network manager management on a list of network interfaces.

    Args:
      interfaces: list of string, the output device names enable.
      logger: logger object, used to write to SysLog and serial port.