diff options
author | John Keiser <john@johnkeiser.com> | 2015-12-10 09:18:15 -0800 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-12-10 14:55:20 -0800 |
commit | 1910740592068982a4b6f9ee58452375d60281d5 (patch) | |
tree | 58e358d3911f769ea3052a14b8e1bc2747b56378 /lib/chef/chef_class.rb | |
parent | d8a869814a0cbe1a44ee47e5c3ac1802a8fef2f2 (diff) | |
download | chef-1910740592068982a4b6f9ee58452375d60281d5.tar.gz |
Warn when user sets a property of an inline resource to itself.
(User will expect "x x" to grab the parent property.)
Diffstat (limited to 'lib/chef/chef_class.rb')
-rw-r--r-- | lib/chef/chef_class.rb | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/chef/chef_class.rb b/lib/chef/chef_class.rb index 6a0d09ec96..5ccb8bb92b 100644 --- a/lib/chef/chef_class.rb +++ b/lib/chef/chef_class.rb @@ -205,17 +205,7 @@ class Chef # @api private this will likely be removed in favor of an as-yet unwritten # `Chef.log` def log_deprecation(message, location=nil) - if !location - # Pick the first caller that is *not* part of the Chef gem, that's the - # thing the user wrote. - chef_gem_path = File.expand_path("../..", __FILE__) - caller(0..10).each do |c| - if !c.start_with?(chef_gem_path) - location = c - break - end - end - end + location ||= Chef::Log.caller_location # `run_context.events` is the primary deprecation target if we're in a # run. If we are not yet in a run, print to `Chef::Log`. if run_context && run_context.events |