Sort attrs

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-06-25 18:07:09 +09:00
parent 3242b3d639
commit fd2e16198e
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1

View File

@ -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