summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-03-21 15:04:02 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-03-21 15:04:02 -0700
commit488e3409910a0e9ec8dcfa67f756e66b10a28cc2 (patch)
tree7134d12f2ef4477fd4905040357bf71d3584ac52
parent50958e958a41f23fb75e9b3c3c9f4c0b519ae295 (diff)
downloadchef-lcg/remove-dead-code.tar.gz
remove dead code from property declarationlcg/remove-dead-code
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 <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/property.rb25
1 files changed, 0 insertions, 25 deletions
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)