Skip to content

Commit

Permalink
remove/merge dup code
Browse files Browse the repository at this point in the history
  • Loading branch information
tagomoris committed May 9, 2016
1 parent 161ecbb commit dacbfff
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions lib/fluent/compat/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def self.secondary_section(conf)
conf.elements.select{|e| e.name == 'secondary'}.first
end

def self.inject_type_from_obsoleted_name(secconf, log)
if secconf['type'] && !secconf['@type']
secconf['@type'] = secconf['type']
log.warn "'type' is deprecated, and will be ignored in v1: use '@type' instead."
end
end
end

module BufferedEventStreamMixin
Expand Down Expand Up @@ -220,10 +226,7 @@ def configure(conf)

secconf = CompatOutputUtils.secondary_section(conf)
if secconf
if secconf['type'] && !secconf['@type']
secconf['@type'] = secconf['type']
log.warn "'type' is deprecated, and will be ignored in v1: use '@type' instead."
end
CompatOutputUtils.inject_type_from_obsoleted_name(secconf, log)
end
end

Expand Down Expand Up @@ -349,10 +352,7 @@ def configure(conf)

secconf = CompatOutputUtils.secondary_section(conf)
if secconf
if secconf['type'] && !secconf['@type']
secconf['@type'] = secconf['type']
log.warn "'type' is deprecated, and will be ignored in v1: use '@type' instead."
end
CompatOutputUtils.inject_type_from_obsoleted_name(secconf, log)
end
end

Expand Down Expand Up @@ -505,10 +505,7 @@ def configure(conf)

secconf = CompatOutputUtils.secondary_section(conf)
if secconf
if secconf['type'] && !secconf['@type']
secconf['@type'] = secconf['type']
log.warn "'type' is deprecated, and will be ignored in v1: use '@type' instead."
end
CompatOutputUtils.inject_type_from_obsoleted_name(secconf, log)
end
end

Expand Down

0 comments on commit dacbfff

Please sign in to comment.