summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-10-14 16:46:51 +0100
committerThom May <thom@chef.io>2016-11-16 16:28:15 +0000
commit64b8b0efd90e59ad609ba30fe4bc7ff19e70e940 (patch)
tree779c33247a0617eed1db6b6a662635a0f91d37d3 /lib/chef/resource
parentbedcbd5f52448d24fdd7ab26ab79185c011beee3 (diff)
downloadchef-64b8b0efd90e59ad609ba30fe4bc7ff19e70e940.tar.gz
Structure deprecations with additional metadatatm/deprecation_with_url
This adds URLs to each class of deprecation, and correctly prints and formats them for maximum user efficiency. We also provide the URL to the data collector for Visibility to ingest. Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/chef_gem.rb5
-rw-r--r--lib/chef/resource/file/verification.rb2
-rw-r--r--lib/chef/resource/user.rb4
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb
index 4445bf0f89..c7c6d91752 100644
--- a/lib/chef/resource/chef_gem.rb
+++ b/lib/chef/resource/chef_gem.rb
@@ -34,9 +34,8 @@ class Chef
# Chef::Resource.run_action: Caveat: this skips Chef::Runner.run_action, where notifications are handled
# Action could be an array of symbols, but probably won't (think install + enable for a package)
if compile_time.nil?
- Chef.log_deprecation "#{self} chef_gem compile_time installation is deprecated"
- Chef.log_deprecation "#{self} Please set `compile_time false` on the resource to use the new behavior."
- Chef.log_deprecation "#{self} or set `compile_time true` on the resource if compile_time behavior is required."
+ message = "#{self} chef_gem compile_time installation is deprecated. Please set `compile_time false` on the resource to use the new behavior, or set `compile_time true` on the resource if compile_time behavior is required."
+ Chef.deprecated :chef_gem_compile_time, message
end
if compile_time || compile_time.nil?
diff --git a/lib/chef/resource/file/verification.rb b/lib/chef/resource/file/verification.rb
index e11035d33f..cf5585e5cf 100644
--- a/lib/chef/resource/file/verification.rb
+++ b/lib/chef/resource/file/verification.rb
@@ -108,7 +108,7 @@ class Chef
def verify_command(path, opts)
# First implementation interpolated `file`; docs & RFC claim `path`
# is interpolated. Until `file` can be deprecated, interpolate both.
- Chef.log_deprecation(
+ Chef.deprecated(:verify_file,
"%{file} is deprecated in verify command and will not be "\
"supported in Chef 13. Please use %{path} instead."
) if @command.include?("%{file}")
diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb
index 06dfe95bd4..19a4e2faf5 100644
--- a/lib/chef/resource/user.rb
+++ b/lib/chef/resource/user.rb
@@ -158,10 +158,10 @@ class Chef
def supports(args = {})
if args.key?(:manage_home)
- Chef.log_deprecation "supports { manage_home: #{args[:manage_home]} } on the user resource is deprecated and will be removed in Chef 13, set manage_home: #{args[:manage_home]} instead"
+ Chef.deprecated(:supports_property, "supports { manage_home: #{args[:manage_home]} } on the user resource is deprecated and will be removed in Chef 13, set manage_home: #{args[:manage_home]} instead")
end
if args.key?(:non_unique)
- Chef.log_deprecation "supports { non_unique: #{args[:non_unique]} } on the user resource is deprecated and will be removed in Chef 13, set non_unique: #{args[:non_unique]} instead"
+ Chef.deprecated(:supports_property, "supports { non_unique: #{args[:non_unique]} } on the user resource is deprecated and will be removed in Chef 13, set non_unique: #{args[:non_unique]} instead")
end
super
end