summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-01-29 11:49:25 -0800
committerGitHub <noreply@github.com>2019-01-29 11:49:25 -0800
commitdbc7e46f006c27a1fc79aa58acf671a09b657748 (patch)
tree5e02b2331d966440db19e8ae463cf5c2013f5c32
parenta16ebbb01d3b591577813d3415c3a99216166e38 (diff)
parente143f3d3349bcde22dedd0ff76d71cb7c69840ad (diff)
downloadchef-dbc7e46f006c27a1fc79aa58acf671a09b657748.tar.gz
Merge pull request #8187 from chef/deprecations
Officially deprecate cookbook shadowing and audit mode
-rw-r--r--lib/chef/application/client.rb4
-rw-r--r--lib/chef/cookbook_loader.rb4
-rw-r--r--lib/chef/deprecated.rb20
-rw-r--r--spec/integration/client/client_spec.rb1
-rw-r--r--spec/integration/client/exit_code_spec.rb1
5 files changed, 22 insertions, 8 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb
index 0e5584ded3..af77f6c584 100644
--- a/lib/chef/application/client.rb
+++ b/lib/chef/application/client.rb
@@ -376,6 +376,10 @@ class Chef::Application::Client < Chef::Application
end
if mode = config[:audit_mode] || Chef::Config[:audit_mode]
+ if [:enabled, :audit_only].include?(mode)
+ Chef.deprecated(:audit_mode, "Chef's Audit mode has been deprecated and will be removed in Chef 15 (April 2019). Consider migrating to InSpec as a replacement for this functionality.")
+ end
+
expected_modes = [:enabled, :disabled, :audit_only]
unless expected_modes.include?(mode)
Chef::Application.fatal!(unrecognized_audit_mode(mode))
diff --git a/lib/chef/cookbook_loader.rb b/lib/chef/cookbook_loader.rb
index 32fd71f604..70b9e0fc50 100644
--- a/lib/chef/cookbook_loader.rb
+++ b/lib/chef/cookbook_loader.rb
@@ -68,8 +68,8 @@ class Chef
def warn_about_cookbook_shadowing
unless merged_cookbooks.empty?
- Chef::Log.deprecation "The cookbook(s): #{merged_cookbooks.join(', ')} exist in multiple places in your cookbook_path. " +
- "A composite version has been compiled. This has been deprecated since 0.10.4, in Chef 13 this behavior will be REMOVED."
+ Chef.deprecated(:cookbook_shadowing, "The cookbook(s): #{merged_cookbooks.join(', ')} exist in multiple places in your cookbook_path. " +
+ "A composite version has been compiled. This has been deprecated since 0.10.4, in Chef 15 this behavior will be REMOVED.")
end
end
diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb
index 1e33fdde0a..825614b96c 100644
--- a/lib/chef/deprecated.rb
+++ b/lib/chef/deprecated.rb
@@ -207,12 +207,6 @@ class Chef
target 23
end
- class MapCollision < Base
- target 25
- end
-
- # id 3694 was deleted
-
# Returned when using the deprecated option on a property
class Property < Base
target 24
@@ -222,10 +216,24 @@ class Chef
end
end
+ class MapCollision < Base
+ target 25
+ end
+
class ShellOut < Base
target 26
end
+ class AuditMode < Base
+ target 27
+ end
+
+ class CookbookShadowing < Base
+ target 28
+ end
+
+ # id 3694 was deleted and should not be reused
+
class Generic < Base
def url
"https://docs.chef.io/chef_deprecations_client.html"
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 4408c00b23..0e8e37bedb 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -434,6 +434,7 @@ EOM
local_mode true
cookbook_path "#{path_to('cookbooks')}"
audit_mode :enabled
+ silence_deprecation_warnings %w{chef-27}
EOM
end
diff --git a/spec/integration/client/exit_code_spec.rb b/spec/integration/client/exit_code_spec.rb
index 7352863dbf..d310a56973 100644
--- a/spec/integration/client/exit_code_spec.rb
+++ b/spec/integration/client/exit_code_spec.rb
@@ -39,6 +39,7 @@ EOM
local_mode true
cookbook_path "#{path_to('cookbooks')}"
audit_mode :audit_only
+ silence_deprecation_warnings %w{chef-27}
EOM
end