Skip to content

Commit

Permalink
Merge pull request #276 from richardc/MCO-558-facts-stacktrace-with-n…
Browse files Browse the repository at this point in the history
…o-fact

MCO-558 `mco facts` stacktrace with no found fact
  • Loading branch information
ploubser committed Jan 21, 2015
2 parents 2baa6f9 + 5c9615f commit e6c5428
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/mcollective/application/facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@ def main
begin
value = resp[:body][:data][:value]
if value
facts.include?(value) ? facts[value] << resp[:senderid] : facts[value] = [ resp[:senderid] ]
if facts.include?(value)
facts[value] << resp[:senderid]
else
facts[value] = [ resp[:senderid] ]
end
end
rescue Exception => e
STDERR.puts "Could not parse facts for #{resp[:senderid]}: #{e.class}: #{e}"
end
end

show_single_fact_report(configuration[:fact], facts, options[:verbose])
if facts.empty?
puts "No values found for fact #{configuration[:fact]}\n"
else
show_single_fact_report(configuration[:fact], facts, options[:verbose])
end

printrpcstats

Expand Down

0 comments on commit e6c5428

Please sign in to comment.