opscode/chef — pull request #214 by gpapilion (2012-01-05 17:29:31+00:00)
Title: Fixes http://tickets.opscode.com/browse/CHEF-2812

This addresses the issue where a resource in a block inherits the not_if and only_if array reference from the first run.

So
item = %w(one two)
variable.each{ |item|
execute "some" do
command "somescript #{item}"
not_if "some_other_script #{item}"
end
}

will produce on first iteration

run_context.resoruce_collection[0].not_if = [ "some_other_script one" ]
run_context.resoruce_collection[0].command = "somescript one"

on the second iteration...
run_context.resoruce_collection[0].not_if = [ "some_other_script one", "some_other_script two"]
run_context.resoruce_collection[0].command = "somescript one"
run_context.resoruce_collection[1].not_if = [ "some_other_script one", "some_other_script two" ]
run_context.resoruce_collection[0].command = "somescript two"

I'm adding output from shef debugging into the jira report.