Skip to content

Commit

Permalink
release-utils fix for ignored logs and normalize empty tags field
Browse files Browse the repository at this point in the history
  • Loading branch information
dpb587 committed Jun 26, 2015
1 parent ea53caf commit f7d066e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion share/release-utils/logs/elasticsearch-mappings/enumerate
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ ARGV.each do | argv |
logyaml = YAML.load_file(logfile)

logyaml['files'].each do | joblogfile, joblogconfig |
if !joblogconfig.has_key? 'fields' or !joblogconfig['fields'].has_key? 'type'
if nil == joblogconfig
next
elsif !joblogconfig.has_key? 'fields' or !joblogconfig['fields'].has_key? 'type'
$stderr.puts "WARNING: #{joblogfile} from job #{job_name} does not define a type field"

next
Expand Down
4 changes: 3 additions & 1 deletion share/release-utils/logs/logstash-filters/enumerate
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ ARGV.each do | argv |
logyaml = YAML.load_file(logfile)

logyaml['files'].each do | joblogfile, joblogconfig |
if !joblogconfig.has_key? 'fields' or !joblogconfig['fields'].has_key? 'type'
if nil == joblogconfig
next
elsif !joblogconfig.has_key? 'fields' or !joblogconfig['fields'].has_key? 'type'
$stderr.puts "WARNING: #{joblogfile} from job #{job_name} does not define a type field"

next
Expand Down
1 change: 1 addition & 0 deletions share/release-utils/logs/logstash-filters/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

sample('@message' => split[0]) do
subject.remove "@version"
subject.remove "tags" if [] === subject['tags']

expected.each do | k, v |
if "@timestamp" == k
Expand Down

0 comments on commit f7d066e

Please sign in to comment.