def config_test(syslog_ng_sbin_dir=None, cfgfile=None):
 params = ['--syntax-only']
 if cfgfile:
  params.append('--cfgfile={0}'.format(cfgfile))
 try:
  ret = _run_command_in_extended_path(syslog_ng_sbin_dir, 'syslog-ng', params)
 except CommandExecutionError as err:
  return _format_return_data(retcode=(-1), stderr=str(err))
 retcode = ret.get('retcode', (-1))
 stderr = ret.get('stderr', None)
 stdout = ret.get('stdout', None)
 return _format_return_data(retcode, stdout, stderr)

def config_test ( syslog_ng_sbin_dir = None , cfgfile = None ) : params = [ '--syntax-only' ] if cfgfile : params . append ( '--cfgfile={0}' . format ( cfgfile ) ) try : ret = _run_command_in_extended_path ( syslog_ng_sbin_dir , 'syslog-ng' , params ) except CommandExecutionError as err : return _format_return_data ( retcode = ( - 1 ) , stderr = str ( err ) ) retcode = ret . get ( 'retcode' , ( - 1 ) ) stderr = ret . get ( 'stderr' , None ) stdout = ret . get ( 'stdout' , None ) return _format_return_data ( retcode , stdout , stderr )
runs syntax check against cfgfile .