summaryrefslogtreecommitdiff
path: root/lib/chef/property.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-12-14 16:55:26 -0800
committerJohn Keiser <john@johnkeiser.com>2015-12-14 17:05:35 -0800
commitfbf1f7d21c059d75b9978b34f9b9b5021c6dbfa3 (patch)
treed9f1f954ef252186680f5dcc9bb698426ca981d8 /lib/chef/property.rb
parent491e99e796673b5a3762d5a47ed51fabf1b6f8f1 (diff)
downloadchef-fbf1f7d21c059d75b9978b34f9b9b5021c6dbfa3.tar.gz
Only warn about potentially duplicate properties during the resource initializerjk/reduce-property-dup-warning
Diffstat (limited to 'lib/chef/property.rb')
-rw-r--r--lib/chef/property.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index 742eba42fd..89e4ffe0e6 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -18,6 +18,8 @@
require 'chef/exceptions'
require 'chef/delayed_evaluator'
+require 'chef/chef_class'
+require 'chef/log'
class Chef
#
@@ -314,9 +316,10 @@ class Chef
#
# It won't do what they expect. This checks whether you try to *read*
# `content` while we are compiling the resource.
- if resource.respond_to?(:enclosing_provider) && resource.enclosing_provider &&
- !resource.currently_running_action &&
- !name_property? &&
+ if resource.respond_to?(:resource_initializing) &&
+ resource.resource_initializing &&
+ resource.respond_to?(:enclosing_provider) &&
+ resource.enclosing_provider &&
resource.enclosing_provider.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