summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-03-17 13:28:30 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-03-17 13:28:30 -0700
commit41ad909cbb9a93ef7809f61c15c0930a434b6734 (patch)
tree56df199c5ac8f52a6f0d027881b4836ac6d9082a
parenta1f9544e2ad149febbdd3e9acaacfec0323c20dd (diff)
downloadchef-lcg/deprecate-chef-solo-legacy-mode.tar.gz
Chef-13: add Chef-14.0 deprecation for chef-solo legacy modelcg/deprecate-chef-solo-legacy-mode
the task isn't finished until we can delete the code. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/chef_class.rb2
-rw-r--r--lib/chef/client.rb3
-rw-r--r--lib/chef/deprecated.rb10
-rw-r--r--spec/integration/solo/solo_spec.rb11
4 files changed, 24 insertions, 2 deletions
diff --git a/lib/chef/chef_class.rb b/lib/chef/chef_class.rb
index e61fd5e1d2..1ce287a323 100644
--- a/lib/chef/chef_class.rb
+++ b/lib/chef/chef_class.rb
@@ -1,6 +1,6 @@
#
# Author:: Lamont Granquist (<lamont@chef.io>)
-# Copyright:: Copyright 2015-2016, Chef Software, Inc.
+# Copyright:: Copyright 2015-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index c064d33209..660dc629de 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -3,7 +3,7 @@
# Author:: Christopher Walters (<cw@chef.io>)
# Author:: Christopher Brown (<cb@chef.io>)
# Author:: Tim Hinderliter (<tim@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software, Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -661,6 +661,7 @@ class Chef
# @api private
#
def converge(run_context)
+ Chef.deprecated(:chef_solo_legacy_mode, "The legacy-mode of chef-solo will be removed in Chef 14.0") if Chef::Config[:solo_legacy_mode]
converge_exception = nil
catch(:end_client_run_early) do
begin
diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb
index 461f65225b..c00ed8aa30 100644
--- a/lib/chef/deprecated.rb
+++ b/lib/chef/deprecated.rb
@@ -220,6 +220,16 @@ class Chef
# id 3694 was deleted
+ class ChefSoloLegacyMode < Base
+ def id
+ 16
+ end
+
+ def target
+ "chef_solo_legacy_mode.html"
+ end
+ end
+
class Generic < Base
def url
"https://docs.chef.io/chef_deprecations_client.html"
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb
index f6cb2e43ef..664f2bd119 100644
--- a/spec/integration/solo/solo_spec.rb
+++ b/spec/integration/solo/solo_spec.rb
@@ -18,6 +18,10 @@ describe "chef-solo" do
let(:chef_solo) { "ruby bin/chef-solo --legacy-mode --minimal-ohai" }
+ before do
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
+ end
+
when_the_repository "creates nodes" do
let(:nodes_dir) { File.join(@repository_dir, "nodes") }
let(:node_file) { Dir[File.join(nodes_dir, "*.json")][0] }
@@ -25,6 +29,7 @@ describe "chef-solo" do
before do
file "config/solo.rb", <<EOM
chef_repo_path "#{@repository_dir}"
+treat_deprecation_warnings_as_errors false
EOM
result = shell_out("ruby bin/chef-solo -c \"#{path_to('config/solo.rb')}\" -l debug", :cwd => chef_dir)
result.error!
@@ -77,6 +82,7 @@ EOM
file "config/solo.rb", <<EOM
cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
+treat_deprecation_warnings_as_errors false
EOM
result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir)
result.error!
@@ -87,6 +93,7 @@ EOM
file "config/solo.rb", <<EOM
cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
+treat_deprecation_warnings_as_errors false
EOM
file "config/node.json", <<-E
@@ -113,6 +120,7 @@ E
file "config/solo.rb", <<EOM
cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
+treat_deprecation_warnings_as_errors false
EOM
result = shell_out("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir)
expect(result.exitstatus).to eq(0) # For CHEF-5120 this becomes 1
@@ -127,6 +135,7 @@ EOM
file "config/solo.rb", <<EOM
cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
+treat_deprecation_warnings_as_errors false
EOM
end
@@ -144,6 +153,7 @@ EOM
file "config/solo.rb", <<EOM
cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
+treat_deprecation_warnings_as_errors false
EOM
end
@@ -176,6 +186,7 @@ EOM
file "config/solo.rb", <<EOM
cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
+treat_deprecation_warnings_as_errors false
EOM
# We have a timeout protection here so that if due to some bug
# run_lock gets stuck we can discover it.