summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Cowie <jcowie@etsy.com>2014-02-19 10:01:20 +0000
committerdanielsdeleo <dan@opscode.com>2014-02-19 09:48:40 -0800
commitdd8c489830883e73178d747e090e77f358afb53b (patch)
treeba4219c1f1d9a6c7b8887210874a3ac9a4ed8832
parentfd8db8959d3d683b2acb0c773abdc9ccf2d84ef7 (diff)
downloadchef-dd8c489830883e73178d747e090e77f358afb53b.tar.gz
Move method call to resource.load_prior_resource to fix CHEF-5052 resource merge issues
-rw-r--r--lib/chef/dsl/recipe.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/dsl/recipe.rb b/lib/chef/dsl/recipe.rb
index a3b6a8cef0..c64291decc 100644
--- a/lib/chef/dsl/recipe.rb
+++ b/lib/chef/dsl/recipe.rb
@@ -119,12 +119,13 @@ class Chef
resource = resource_class.new(name, run_context)
resource.source_line = created_at
- resource.cookbook_name = cookbook_name
- resource.recipe_name = recipe_name
# If we have a resource like this one, we want to steal its state
# 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
resource.load_prior_resource
+ resource.cookbook_name = cookbook_name
+ resource.recipe_name = recipe_name
# Determine whether this resource is being created in the context of an enclosing Provider
resource.enclosing_provider = self.is_a?(Chef::Provider) ? self : nil