From fd2e16198ee15466fd1e78a709a4cdf2259e8b70 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Mon, 25 Jun 2018 18:07:09 +0900 Subject: [PATCH] Sort attrs Signed-off-by: Kenji Okimoto --- app/models/concerns/fluentd/setting/section_config.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/fluentd/setting/section_config.rb b/app/models/concerns/fluentd/setting/section_config.rb index 13b54e5..845c39c 100644 --- a/app/models/concerns/fluentd/setting/section_config.rb +++ b/app/models/concerns/fluentd/setting/section_config.rb @@ -12,7 +12,7 @@ class Fluentd argument = _attributes.delete(self._argument_name.to_s) || "" attrs, elements = parse_attributes(_attributes) if attrs.present? || elements.present? - config_element(section_name, argument, attrs, elements) + config_element(section_name, argument, attrs.sort.to_h, elements) end end @@ -28,6 +28,9 @@ class Fluentd attrs = params.to_h.reject do |key, value| skip?(key.to_sym, value) end + unless attrs.blank? + attrs["@type"] = params.to_h["@type"] + end return attrs, elements end