def _write_file_ppp_ifaces(iface, data):
 try:
  template = JINJA.get_template('debian_ppp_eth.jinja')
 except jinja2.exceptions.TemplateNotFound:
  log.error('Could not load template debian_ppp_eth.jinja')
  return ''
 adapters = _parse_interfaces()
 adapters[iface] = data
 ifcfg = ''
 tmp = template.render({'data': adapters[iface]})
 ifcfg = (tmp + ifcfg)
 filename = ((_DEB_PPP_DIR + '/') + adapters[iface]['data']['inet']['provider'])
 if (not os.path.exists(os.path.dirname(filename))):
  msg = '{0} cannot be written.'
  msg = msg.format(os.path.dirname(filename))
  log.error(msg)
  raise AttributeError(msg)
 with salt.utils.fopen(filename, 'w') as fout:
  fout.write(ifcfg)
 return filename

def _write_file_ppp_ifaces ( iface , data ) : try : template = JINJA . get_template ( 'debian_ppp_eth.jinja' ) except jinja2 . exceptions . TemplateNotFound : log . error ( 'Could not load template debian_ppp_eth.jinja' ) return '' adapters = _parse_interfaces ( ) adapters [ iface ] = data ifcfg = '' tmp = template . render ( { 'data' : adapters [ iface ] } ) ifcfg = ( tmp + ifcfg ) filename = ( ( _DEB_PPP_DIR + '/' ) + adapters [ iface ] [ 'data' ] [ 'inet' ] [ 'provider' ] ) if ( not os . path . exists ( os . path . dirname ( filename ) ) ) : msg = '{0} cannot be written.' msg = msg . format ( os . path . dirname ( filename ) ) log . error ( msg ) raise AttributeError ( msg ) with salt . utils . fopen ( filename , 'w' ) as fout : fout . write ( ifcfg ) return filename
writes a file to disk .