def _proxy_conf_file(proxyfile, test):
 changes_old = []
 changes_new = []
 success = True
 if (not os.path.exists(proxyfile)):
  try:
   if (not test):
    changes_new.append(_write_proxy_conf(proxyfile))
    msg = 'Salt Proxy: Wrote proxy conf {0}'.format(proxyfile)
   else:
    msg = 'Salt Proxy: Update required to proxy conf {0}'.format(proxyfile)
  except (OSError, IOError) as err:
   success = False
   msg = 'Salt Proxy: Error writing proxy file {0}'.format(err)
   log.error(msg)
   changes_new.append(msg)
  changes_new.append(msg)
  log.debug(msg)
 else:
  msg = 'Salt Proxy: {0} already exists, skipping'.format(proxyfile)
  changes_old.append(msg)
  log.debug(msg)
 return (success, changes_new, changes_old)

def _proxy_conf_file ( proxyfile , test ) : changes_old = [ ] changes_new = [ ] success = True if ( not os . path . exists ( proxyfile ) ) : try : if ( not test ) : changes_new . append ( _write_proxy_conf ( proxyfile ) ) msg = 'Salt Proxy: Wrote proxy conf {0}' . format ( proxyfile ) else : msg = 'Salt Proxy: Update required to proxy conf {0}' . format ( proxyfile ) except ( OSError , IOError ) as err : success = False msg = 'Salt Proxy: Error writing proxy file {0}' . format ( err ) log . error ( msg ) changes_new . append ( msg ) changes_new . append ( msg ) log . debug ( msg ) else : msg = 'Salt Proxy: {0} already exists, skipping' . format ( proxyfile ) changes_old . append ( msg ) log . debug ( msg ) return ( success , changes_new , changes_old )
check if proxy conf exists and update .