mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
It turns out that it would fail every time if…
Consistent failure if I didn't put `next if typename.nil?` before the rest of the statement. This compromise puts 2 `next if` statements, then an implied `else` since those were the two conditions I needed to check 😄
This commit is contained in:
parent
56b7f1b274
commit
6bf38771c1
1 changed files with 5 additions and 4 deletions
|
@ -120,12 +120,13 @@ class LogStash::Codecs::Collectd < LogStash::Codecs::Base
|
|||
@logger.info("Getting Collectd typesdb info", :typesdb => path.to_s)
|
||||
File.open(path, 'r').each_line do |line|
|
||||
typename, *line = line.strip.split
|
||||
next if typename.nil? || if typename[0,1] != '#' # Don't process commented or blank lines
|
||||
@logger.debug("typename", :typename => typename.to_s)
|
||||
next if typename.nil?
|
||||
next if typename[0,1] == '#'
|
||||
v = line.collect { |l| l.strip.split(":")[0] }
|
||||
types[typename] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
@logger.debug("Collectd Types", :types => types.to_s)
|
||||
return types
|
||||
end # def get_types
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue