def write_version(name):
 line = '@version: {0}'.format(name)
 try:
  if os.path.exists(__SYSLOG_NG_CONFIG_FILE):
   log.debug('Removing previous configuration file: {0}'.format(__SYSLOG_NG_CONFIG_FILE))
   os.remove(__SYSLOG_NG_CONFIG_FILE)
   log.debug('Configuration file successfully removed')
  header = _format_generated_config_header()
  _write_config(config=header, newlines=1)
  _write_config(config=line, newlines=2)
  return _format_state_result(name, result=True)
 except OSError as err:
  log.error("Failed to remove previous configuration file '{0}': {1}".format(__SYSLOG_NG_CONFIG_FILE, str(err)))
  return _format_state_result(name, result=False)

def write_version ( name ) : line = '@version: {0}' . format ( name ) try : if os . path . exists ( __SYSLOG_NG_CONFIG_FILE ) : log . debug ( 'Removing previous configuration file: {0}' . format ( __SYSLOG_NG_CONFIG_FILE ) ) os . remove ( __SYSLOG_NG_CONFIG_FILE ) log . debug ( 'Configuration file successfully removed' ) header = _format_generated_config_header ( ) _write_config ( config = header , newlines = 1 ) _write_config ( config = line , newlines = 2 ) return _format_state_result ( name , result = True ) except OSError as err : log . error ( "Failed to remove previous configuration file '{0}': {1}" . format ( __SYSLOG_NG_CONFIG_FILE , str ( err ) ) ) return _format_state_result ( name , result = False )
removes the previous configuration file .