def _write_file(folder, filename, data):
 path = os.path.join(folder, filename)
 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.fopen(path, 'w') as fp_:
  fp_.write(data)
 return 0

def _write_file ( folder , filename , data ) : path = os . path . join ( folder , filename ) 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 . fopen ( path , 'w' ) as fp_ : fp_ . write ( data ) return 0
writes a file to disk .