code: def _write_proxy_conf(proxyfile):
      '''
      write to file
      '''
      msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \
          .format(proxyfile)
  
      log.trace('Salt Proxy Module: write proxy conf')
  
      if proxyfile:
          log.debug('Writing proxy conf file')
          with salt.utils.files.fopen(proxyfile, 'w') as proxy_conf:
              proxy_conf.write(salt.utils.stringutils.to_str('master = {0}'
                               .format(__grains__['master'])))
          msg = 'Wrote proxy file {0}'.format(proxyfile)
          log.debug(msg)
  
      return msf _write_proxy_conf(proxyfile):
      '''
      write to file
      '''
      msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \
          .format(proxyfile)
  
      log.trace('Salt Proxy Module: write proxy conf')
  
      if proxyfile:
          log.debug('Writing proxy conf file')
          with salt.utils.files.fopen(proxyfile, 'w') as proxy_conf:
              proxy_conf.write(salt.utils.stringutils.to_str('master = {0}'
                               .format(__grains__['master'])))
          msg = 'Wrote proxy file {0}'.format(proxyfile)
          log.debug(msg)
  
      return msg
docs: write to file