summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-01-17 11:29:34 -0800
committerdanielsdeleo <dan@opscode.com>2013-01-17 11:29:34 -0800
commitb568c4d060765e75023f50f24d0a394ada5aed0b (patch)
tree24cd8ea0eb39b18f060c931b8e4c5667347f2d1e
parent186eb9cacc54f73292b6c256cfae4866744a6c21 (diff)
parent909c147ce768bfed57325f4ef584c680fe807dd8 (diff)
downloadchef-b568c4d060765e75023f50f24d0a394ada5aed0b.tar.gz
Merge branch 'CHEF-3771' into 10-stable
-rw-r--r--chef/lib/chef/resource.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/chef/lib/chef/resource.rb b/chef/lib/chef/resource.rb
index b5ed8b74bb..bebb3a1d82 100644
--- a/chef/lib/chef/resource.rb
+++ b/chef/lib/chef/resource.rb
@@ -262,9 +262,12 @@ F
def load_prior_resource
begin
- Chef::Log.warn("Cloning resource attributes for #{self.to_s} from prior resource (CHEF-3694)")
- Chef::Log.warn("From: #{self.source_line}") if self.source_line
prior_resource = run_context.resource_collection.lookup(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 || iv.to_sym == :@not_if || iv.to_sym == :@only_if
self.instance_variable_set(iv, prior_resource.instance_variable_get(iv))