Skip to content

Instantly share code, notes, and snippets.

@adamhjk
Created April 1, 2011 06:08
Show Gist options
  • Save adamhjk/897812 to your computer and use it in GitHub Desktop.
Save adamhjk/897812 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