summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 095a07c2e0..f3dabc5b28 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -266,9 +266,13 @@ F
def load_prior_resource
begin
prior_resource = run_context.resource_collection.lookup(self.to_s)
- Chef::Log.debug("Setting #{self.to_s} to the state of the prior #{self.to_s}")
+ # if we get here, there is a prior resource (otherwise we'd have jumped
+ # to the rescue clause).
+ Chef::Log.warn("Cloning resource attributes for #{self.to_s} from prior resource (CHEF-3694)")
+ Chef::Log.warn("Previous #{prior_resource}: #{prior_resource.source_line}") if prior_resource.source_line
+ Chef::Log.warn("Current #{self}: #{self.source_line}") if self.source_line
prior_resource.instance_variables.each do |iv|
- unless iv.to_sym == :@source_line || iv.to_sym == :@action
+ unless iv.to_sym == :@source_line || iv.to_sym == :@action || iv.to_sym == :@not_if || iv.to_sym == :@only_if
self.instance_variable_set(iv, prior_resource.instance_variable_get(iv))
end
end