Permalink
Browse files

Merge pull request #2 from philk/fix-blacklist

gelf: Fix sanitised_changes method
  • Loading branch information...
2 parents 8e38fcd + 8058768 commit 1505440e8b322b41e835e31cbea6a27c23ac27f3 @jellybob committed Dec 19, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/chef/gelf.rb
View
@@ -61,13 +61,13 @@ def changes
def sanitised_changes
run_status.updated_resources.reject do |updated|
- options[:blacklist].each do |cookbook, resources|
- resources.each do |resource, actions|
- updated.cookbook_name == cookbook &&
- updated.resource_name == resource &&
- actions.collect { |a| a.to_s }.include?(updated.action.to_s)
- end
+ cookbook = @options[:blacklist][updated.cookbook_name]
+ if cookbook
+ resource = cookbook[updated.resource_name.to_s] || []
+ else
+ resource = []
end
+ cookbook && resource.include?(updated.action.to_s)
end
end
end

0 comments on commit 1505440

Please sign in to comment.