From 2a52b0208a4f22ff2eed04da980d9c32c175e122 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 22 Jan 2019 13:22:59 -0800 Subject: Add a deprecation warning to knife cookbook site We'll want to backport this to Chef 14 as well. Signed-off-by: Tim Smith --- lib/chef/knife/cookbook_site_download.rb | 8 +++++++- lib/chef/knife/cookbook_site_install.rb | 7 ++++++- lib/chef/knife/cookbook_site_list.rb | 7 ++++++- lib/chef/knife/cookbook_site_search.rb | 7 ++++++- lib/chef/knife/cookbook_site_share.rb | 7 ++++++- lib/chef/knife/cookbook_site_show.rb | 7 ++++++- lib/chef/knife/cookbook_site_unshare.rb | 7 ++++++- 7 files changed, 43 insertions(+), 7 deletions(-) diff --git a/lib/chef/knife/cookbook_site_download.rb b/lib/chef/knife/cookbook_site_download.rb index 95a339bac9..e288bcaf4f 100644 --- a/lib/chef/knife/cookbook_site_download.rb +++ b/lib/chef/knife/cookbook_site_download.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2009-2016, Chef Software, Inc. +# Copyright:: Copyright 2009-2019, Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,6 +29,12 @@ class Chef banner "knife cookbook site download COOKBOOK [VERSION] (options)" category "deprecated" + + def run + Chef::Log.warn("knife cookbook site download has been deprecated in favor of knife supermarket download. In Chef 16 (April 2020) this will result in an error!") + super + end + end end end diff --git a/lib/chef/knife/cookbook_site_install.rb b/lib/chef/knife/cookbook_site_install.rb index cf955e0ca4..433e572533 100644 --- a/lib/chef/knife/cookbook_site_install.rb +++ b/lib/chef/knife/cookbook_site_install.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2010-2018, Chef Software Inc. +# Copyright:: Copyright 2010-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,11 @@ class Chef banner "knife cookbook site install COOKBOOK [VERSION] (options)" category "deprecated" + def run + Chef::Log.warn("knife cookbook site install has been deprecated in favor of knife supermarket install. In Chef 16 (April 2020) this will result in an error!") + super + end + end end end diff --git a/lib/chef/knife/cookbook_site_list.rb b/lib/chef/knife/cookbook_site_list.rb index 36623e09a5..5b65420e4f 100644 --- a/lib/chef/knife/cookbook_site_list.rb +++ b/lib/chef/knife/cookbook_site_list.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2009-2016, Chef Software Inc. +# Copyright:: Copyright 2009-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,11 @@ class Chef banner "knife cookbook site list (options)" category "deprecated" + def run + Chef::Log.warn("knife cookbook site list has been deprecated in favor of knife supermarket list. In Chef 16 (April 2020) this will result in an error!") + super + end + end end end diff --git a/lib/chef/knife/cookbook_site_search.rb b/lib/chef/knife/cookbook_site_search.rb index 92234421f9..21ea045ed3 100644 --- a/lib/chef/knife/cookbook_site_search.rb +++ b/lib/chef/knife/cookbook_site_search.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2009-2016, Chef Software Inc. +# Copyright:: Copyright 2009-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,11 @@ class Chef banner "knife cookbook site search QUERY (options)" category "deprecated" + def run + Chef::Log.warn("knife cookbook site search has been deprecated in favor of knife supermarket search. In Chef 16 (April 2020) this will result in an error!") + super + end + end end end diff --git a/lib/chef/knife/cookbook_site_share.rb b/lib/chef/knife/cookbook_site_share.rb index 1cc0c8a017..6fe4bbb520 100644 --- a/lib/chef/knife/cookbook_site_share.rb +++ b/lib/chef/knife/cookbook_site_share.rb @@ -1,7 +1,7 @@ # # Author:: Nuo Yan () # Author:: Tim Hinderliter () -# Copyright:: Copyright 2010-2016, Chef Software Inc. +# Copyright:: Copyright 2010-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,6 +31,11 @@ class Chef banner "knife cookbook site share COOKBOOK [CATEGORY] (options)" category "deprecated" + def run + Chef::Log.warn("knife cookbook site share has been deprecated in favor of knife supermarket share. In Chef 16 (April 2020) this will result in an error!") + super + end + end end end diff --git a/lib/chef/knife/cookbook_site_show.rb b/lib/chef/knife/cookbook_site_show.rb index a5e92e70ab..4a8d7c090e 100644 --- a/lib/chef/knife/cookbook_site_show.rb +++ b/lib/chef/knife/cookbook_site_show.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2009-2016, Chef Software Inc. +# Copyright:: Copyright 2009-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,11 @@ class Chef banner "knife cookbook site show COOKBOOK [VERSION] (options)" category "deprecated" + def run + Chef::Log.warn("knife cookbook site show has been deprecated in favor of knife supermarket show. In Chef 16 (April 2020) this will result in an error!") + super + end + end end end diff --git a/lib/chef/knife/cookbook_site_unshare.rb b/lib/chef/knife/cookbook_site_unshare.rb index 15f84711cb..850511e650 100644 --- a/lib/chef/knife/cookbook_site_unshare.rb +++ b/lib/chef/knife/cookbook_site_unshare.rb @@ -1,7 +1,7 @@ # # Author:: Stephen Delano () # Author:: Tim Hinderliter () -# Copyright:: Copyright 2010-2016, Chef Software Inc. +# Copyright:: Copyright 2010-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,6 +31,11 @@ class Chef banner "knife cookbook site unshare COOKBOOK (options)" category "deprecated" + def run + Chef::Log.warn("knife cookbook site unshare has been deprecated in favor of knife supermarket unshare. In Chef 16 (April 2020) this will result in an error!") + super + end + end end end -- cgit v1.2.1