mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-19 21:41:11 +02:00
Fix label handling while validation
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
07cbac40eb
commit
f66929bf5b
@ -10,7 +10,12 @@ class Fluentd
|
|||||||
def validate_configuration
|
def validate_configuration
|
||||||
original_log = $log
|
original_log = $log
|
||||||
$log = DummyLogger.logger
|
$log = DummyLogger.logger
|
||||||
config = to_config.to_s.lines[1..-2].join
|
full_config = to_config.to_s
|
||||||
|
config = if full_config.start_with?("<label ")
|
||||||
|
full_config.lines[2..-3].join
|
||||||
|
else
|
||||||
|
full_config.lines[1..-2].join
|
||||||
|
end
|
||||||
self.class.create_driver(config)
|
self.class.create_driver(config)
|
||||||
rescue Fluent::ConfigError => ex
|
rescue Fluent::ConfigError => ex
|
||||||
errors.add(:base, :invalid, message: ex.message)
|
errors.add(:base, :invalid, message: ex.message)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user