summaryrefslogtreecommitdiff
path: root/lib/chef/deprecated.rb
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2018-06-14 19:38:31 -0700
committerNoah Kantrowitz <noah@coderanger.net>2018-06-14 19:39:59 -0700
commit67530a948eba39ea809ed2e869cec2436f389c89 (patch)
tree2a569faa3e14e845f156112fd981b72ab9407ca2 /lib/chef/deprecated.rb
parent631d79e736ee5ab7001dbbbfcc1a3ffc8f96b052 (diff)
downloadchef-67530a948eba39ea809ed2e869cec2436f389c89.tar.gz
Allow targeting via the deprecation ID, either as a number or in the CHEF-n form we show in various places.
This is because users might not actually know the deprecation key, so this is probably more approachable. Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef/deprecated.rb')
-rw-r--r--lib/chef/deprecated.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb
index b490556ddc..944cecf61b 100644
--- a/lib/chef/deprecated.rb
+++ b/lib/chef/deprecated.rb
@@ -68,7 +68,7 @@ class Chef
# Just in case someone uses a symbol in the config by mistake.
silence_spec = silence_spec.to_s
# Check for a silence by deprecation name, or by location.
- self.class.deprecation_key == silence_spec || location.include?(silence_spec)
+ self.class.deprecation_key == silence_spec || self.class.deprecation_id.to_s == silence_spec || "chef-#{self.class.deprecation_id}" == silence_spec.downcase || location.include?(silence_spec)
end
# check if this warning has been silenced by inline comment.
return true if location =~ /^(.*?):(\d+):in/ && begin