summaryrefslogtreecommitdiff
path: root/lib/chef/provider.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-05-15 23:05:55 -0700
committerJohn Keiser <john@johnkeiser.com>2015-06-23 14:42:27 -0700
commit87a8b49efbccb6934ff2bacb8f8df53d1caf5e46 (patch)
tree98857dc3e898a417def568db35296b3e8fbf9243 /lib/chef/provider.rb
parentd505a314fee15e5b5de411e2c27a7cdbd2a0e48b (diff)
downloadchef-87a8b49efbccb6934ff2bacb8f8df53d1caf5e46.tar.gz
Give run contexts children instead of using external duping
Diffstat (limited to 'lib/chef/provider.rb')
-rw-r--r--lib/chef/provider.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 131b72cd23..12f11d26af 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -200,12 +200,14 @@ class Chef
# manipulating notifies.
converge_by ("evaluate block and run any associated actions") do
- saved_run_context = @run_context
- @run_context = @run_context.dup
- @run_context.resource_collection = Chef::ResourceCollection.new
- instance_eval(&block)
- Chef::Runner.new(@run_context).converge
- @run_context = saved_run_context
+ saved_run_context = run_context
+ begin
+ @run_context = run_context.create_child
+ instance_eval(&block)
+ Chef::Runner.new(run_context).converge
+ ensure
+ @run_context = saved_run_context
+ end
end
end