def _parse_current_network_settings():
 opts = salt.utils.odict.OrderedDict()
 opts['networking'] = ''
 if os.path.isfile(_DEB_NETWORKING_FILE):
  with salt.utils.fopen(_DEB_NETWORKING_FILE) as contents:
   for line in contents:
    if line.startswith('#'):
     continue
    elif line.startswith('CONFIGURE_INTERFACES'):
     opts['networking'] = line.split('=', 1)[1].strip()
 hostname = _parse_hostname()
 domainname = _parse_domainname()
 searchdomain = _parse_searchdomain()
 opts['hostname'] = hostname
 opts['domainname'] = domainname
 opts['searchdomain'] = searchdomain
 return opts

def _parse_current_network_settings ( ) : opts = salt . utils . odict . OrderedDict ( ) opts [ 'networking' ] = '' if os . path . isfile ( _DEB_NETWORKING_FILE ) : with salt . utils . fopen ( _DEB_NETWORKING_FILE ) as contents : for line in contents : if line . startswith ( '#' ) : continue elif line . startswith ( 'CONFIGURE_INTERFACES' ) : opts [ 'networking' ] = line . split ( '=' , 1 ) [ 1 ] . strip ( ) hostname = _parse_hostname ( ) domainname = _parse_domainname ( ) searchdomain = _parse_searchdomain ( ) opts [ 'hostname' ] = hostname opts [ 'domainname' ] = domainname opts [ 'searchdomain' ] = searchdomain return opts
parse /etc/default/networking and return current configuration .