summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2020-08-21 16:49:43 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2020-08-25 16:31:47 +0530
commitb1eb31f3f84aeaf37bdf8c35b5c1bd5a2a290967 (patch)
treee73ea9b245c6270c3ef568f7c8657fcc83adf9e0
parent03f822e5e1772f3ad7c7c5232f5c17f6263f6688 (diff)
downloadchef-b1eb31f3f84aeaf37bdf8c35b5c1bd5a2a290967.tar.gz
Add deprecation warning
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r--lib/chef/knife/config_get.rb3
-rw-r--r--lib/chef/knife/config_get_profile.rb3
-rw-r--r--lib/chef/knife/config_list_profiles.rb3
-rw-r--r--lib/chef/knife/config_use_profile.rb3
4 files changed, 12 insertions, 0 deletions
diff --git a/lib/chef/knife/config_get.rb b/lib/chef/knife/config_get.rb
index 9a57d14316..023c82e8a9 100644
--- a/lib/chef/knife/config_get.rb
+++ b/lib/chef/knife/config_get.rb
@@ -23,6 +23,7 @@ class Chef
class Knife
class ConfigGet < Knife
banner "knife config get [OPTION...] (options)\nDisplays the value of Chef::Config[OPTION] (or all config values)"
+ category "deprecated"
option :all,
short: "-a",
@@ -37,6 +38,8 @@ class Chef
default: false
def run
+ Chef::Log.warn("knife config get has been deprecated in favor of knife config show. This will removed in marjor release verison!")
+
if config[:format] == "summary" && !config[:raw]
# If using the default, human-readable output, also show which config files are being loaded.
# Some of this is a bit hacky since it duplicates
diff --git a/lib/chef/knife/config_get_profile.rb b/lib/chef/knife/config_get_profile.rb
index 716c65dc4b..5fe1d27ffc 100644
--- a/lib/chef/knife/config_get_profile.rb
+++ b/lib/chef/knife/config_get_profile.rb
@@ -21,6 +21,7 @@ class Chef
class Knife
class ConfigGetProfile < Knife
banner "knife config get-profile"
+ category "deprecated"
# Disable normal config loading since this shouldn't fail if the profile
# doesn't exist of the config is otherwise corrupted.
@@ -29,6 +30,8 @@ class Chef
end
def run
+ Chef::Log.warn("knife config get-profiles has been deprecated in favor of knife config use. This will removed in marjor release verison!")
+
ui.msg(self.class.config_loader.credentials_profile(config[:profile]))
end
diff --git a/lib/chef/knife/config_list_profiles.rb b/lib/chef/knife/config_list_profiles.rb
index f652377e89..cd33a9a05a 100644
--- a/lib/chef/knife/config_list_profiles.rb
+++ b/lib/chef/knife/config_list_profiles.rb
@@ -21,6 +21,7 @@ class Chef
class Knife
class ConfigListProfiles < Knife
banner "knife config list-profiles (options)"
+ category "deprecated"
deps do
require_relative "../workstation_config_loader"
@@ -37,6 +38,8 @@ class Chef
end
def run
+ Chef::Log.warn("knife config list-profiles has been deprecated in favor of knife config list. This will removed in marjor release verison!")
+
credentials_data = self.class.config_loader.parse_credentials_file
if credentials_data.nil? || credentials_data.empty?
# Should this just show the ambient knife.rb config as "default" instead?
diff --git a/lib/chef/knife/config_use_profile.rb b/lib/chef/knife/config_use_profile.rb
index 745a250523..7a50efcb1e 100644
--- a/lib/chef/knife/config_use_profile.rb
+++ b/lib/chef/knife/config_use_profile.rb
@@ -21,6 +21,7 @@ class Chef
class Knife
class ConfigUseProfile < Knife
banner "knife config use-profile PROFILE"
+ category "deprecated"
deps do
require "fileutils" unless defined?(FileUtils)
@@ -33,6 +34,8 @@ class Chef
end
def run
+ Chef::Log.warn("knife config use-profile has been deprecated in favor of knife config use. This will removed in marjor release verison!")
+
credentials_data = self.class.config_loader.parse_credentials_file
context_file = ChefConfig::PathHelper.home(".chef", "context").freeze
profile = @name_args[0]&.strip