Skip to content

Instantly share code, notes, and snippets.

@jtimberman
Forked from adamhjk/default.rb
Created June 9, 2011 14:49
Show Gist options
  • Save jtimberman/1016871 to your computer and use it in GitHub Desktop.
Save jtimberman/1016871 to your computer and use it in GitHub Desktop.
run_context.resource_collection.each do |r|
r.source_line =~ /cookbooks\/(.+?)\/recipes\/(.+)\.rb:.+/
cookbook_name = $1
recipe_part = $2.gsub('/', "::")
recipe_name = "#{cookbook_name}::#{recipe_part}"
if node[:isolation][:recipes].include?(recipe_name) || node[:isolation][:cookbooks].include?(cookbook_name)
Chef::Log.info("Setting #{r.to_s} to ignore failure, via the isolation cookbook")
r.ignore_failure(true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment