mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 10:56:11 +02:00
DRY
This commit is contained in:
parent
a4c88f23aa
commit
e0f0ccdc3b
@ -43,10 +43,7 @@ class Fluentd
|
||||
end
|
||||
|
||||
def dryrun!(file_path = nil)
|
||||
Bundler.with_clean_env do
|
||||
system("fluentd -q --dry-run #{options_to_argv(config_file: file_path)}", out: File::NULL, err: File::NULL)
|
||||
raise ::Fluentd::Agent::ConfigError, last_error_message unless $?.exitstatus.zero?
|
||||
end
|
||||
exec_dryrun("fluentd", file_path)
|
||||
end
|
||||
|
||||
def config_syntax_check
|
||||
|
||||
@ -82,6 +82,13 @@ class Fluentd
|
||||
|
||||
private
|
||||
|
||||
def exec_dryrun(exe, file_path = nil)
|
||||
Bundler.with_clean_env do
|
||||
system("#{exe} -q --dry-run #{options_to_argv(config_file: file_path)}", out: File::NULL, err: File::NULL)
|
||||
raise ::Fluentd::Agent::ConfigError, last_error_message unless $?.exitstatus.zero?
|
||||
end
|
||||
end
|
||||
|
||||
def backup_config
|
||||
return unless File.exists? config_file
|
||||
|
||||
|
||||
@ -17,10 +17,7 @@ class Fluentd
|
||||
end
|
||||
|
||||
def dryrun!(file_path = nil)
|
||||
Bundler.with_clean_env do
|
||||
system("/usr/sbin/td-agent --dry-run #{options_to_argv(config_file: file_path)}", out: File::NULL, err: File::NULL)
|
||||
raise ::Fluentd::Agent::ConfigError, last_error_message unless $?.exitstatus.zero?
|
||||
end
|
||||
exec_dryrun("/usr/sbin/td-agent", file_path)
|
||||
end
|
||||
|
||||
case FluentdUI.platform
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user