def _write_file_routes(iface, data, folder, pattern):
 filename = os.path.join(folder, pattern.format(iface))
 if (not os.path.exists(folder)):
  msg = '{0} cannot be written. {1} does not exist'
  msg = msg.format(filename, folder)
  log.error(msg)
  raise AttributeError(msg)
 with salt.utils.flopen(filename, 'w') as fout:
  fout.write(data)
 __salt__['file.set_mode'](filename, '0755')
 return filename

def _write_file_routes ( iface , data , folder , pattern ) : filename = os . path . join ( folder , pattern . format ( iface ) ) if ( not os . path . exists ( folder ) ) : msg = '{0} cannot be written. {1} does not exist' msg = msg . format ( filename , folder ) log . error ( msg ) raise AttributeError ( msg ) with salt . utils . flopen ( filename , 'w' ) as fout : fout . write ( data ) __salt__ [ 'file.set_mode' ] ( filename , '0755' ) return filename
writes a file to disk .