From f0f89d3e3330bfa084d5d6b6d1b95fc72120e582 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 18 Apr 2016 11:48:11 -0700 Subject: add global and per-resource toggles for resource cloning behavior let us turn on and off resource cloning --- lib/chef/resource_builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/chef/resource_builder.rb') diff --git a/lib/chef/resource_builder.rb b/lib/chef/resource_builder.rb index 78b2fcd4d1..607e78358a 100644 --- a/lib/chef/resource_builder.rb +++ b/lib/chef/resource_builder.rb @@ -56,7 +56,7 @@ class Chef # This behavior is very counter-intuitive and should be removed. # See CHEF-3694, https://tickets.opscode.com/browse/CHEF-3694 # Moved to this location to resolve CHEF-5052, https://tickets.opscode.com/browse/CHEF-5052 - if prior_resource + if prior_resource && run_context.resource_cloning resource.load_from(prior_resource) end @@ -80,7 +80,7 @@ class Chef end # emit a cloned resource warning if it is warranted - if prior_resource + if prior_resource && run_context.resource_cloning if is_trivial_resource?(prior_resource) && identicalish_resources?(prior_resource, resource) emit_harmless_cloning_debug else -- cgit v1.2.1