From 488e3409910a0e9ec8dcfa67f756e66b10a28cc2 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Wed, 21 Mar 2018 15:04:02 -0700 Subject: remove dead code from property declaration this is effectively dead because of forcing new_resource.thingy i stuck a hard `raise` in here and we have no tests around this any more. the conditional also just makes my head hurt looking at it. Signed-off-by: Lamont Granquist --- lib/chef/property.rb | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'lib/chef/property.rb') diff --git a/lib/chef/property.rb b/lib/chef/property.rb index be54c8bfa1..942fff0ee9 100644 --- a/lib/chef/property.rb +++ b/lib/chef/property.rb @@ -336,31 +336,6 @@ class Chef else # We are getting the default value. - # If the user does something like this: - # - # ``` - # class MyResource < Chef::Resource - # property :content - # action :create do - # file '/x.txt' do - # content content - # end - # end - # end - # ``` - # - # It won't do what they expect. This checks whether you try to *read* - # `content` while we are compiling the resource. - if !nil_set && - resource.respond_to?(:resource_initializing) && - resource.resource_initializing && - resource.respond_to?(:enclosing_provider) && - resource.enclosing_provider && - resource.enclosing_provider.new_resource && - resource.enclosing_provider.new_resource.respond_to?(name) - Chef::Log.warn("#{Chef::Log.caller_location}: property #{name} is declared in both #{resource} and #{resource.enclosing_provider}. Use new_resource.#{name} instead. At #{Chef::Log.caller_location}") - end - if has_default? # If we were able to cache the stored_default, grab it. if defined?(@stored_default) -- cgit v1.2.1