From 41ad909cbb9a93ef7809f61c15c0930a434b6734 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 17 Mar 2017 13:28:30 -0700 Subject: Chef-13: add Chef-14.0 deprecation for chef-solo legacy mode the task isn't finished until we can delete the code. Signed-off-by: Lamont Granquist --- lib/chef/chef_class.rb | 2 +- lib/chef/client.rb | 3 ++- lib/chef/deprecated.rb | 10 ++++++++++ spec/integration/solo/solo_spec.rb | 11 +++++++++++ 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 () -# 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 () # Author:: Christopher Brown () # Author:: Tim Hinderliter () -# 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", < chef_dir) result.error! @@ -77,6 +82,7 @@ EOM file "config/solo.rb", < chef_dir) result.error! @@ -87,6 +93,7 @@ EOM file "config/solo.rb", < chef_dir) expect(result.exitstatus).to eq(0) # For CHEF-5120 this becomes 1 @@ -127,6 +135,7 @@ EOM file "config/solo.rb", <