summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-03-17 18:20:41 -0400
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-03-20 11:27:03 -0400
commit8366c821df4a58a0e529f0dbeb3a7a78cefcb707 (patch)
tree09d65bf0fc1352600d01dc820a3ac83b9dcc4a50
parentd2dd332132fef834a55b7ad21eba6b2312cc5a27 (diff)
downloadchef-8366c821df4a58a0e529f0dbeb3a7a78cefcb707.tar.gz
Deprecate things instead of removing them outright.
-rw-r--r--lib/chef/config.rb5
-rw-r--r--lib/chef/knife/core/subcommand_loader.rb8
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index 058e74e83d..a9fa9f1552 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -570,6 +570,11 @@ class Chef
ENV
end
+ def self.windows_home_path
+ Chef::Log.deprecation("Chef::Config.windows_home_path is now deprecated. Consider using Chef::Util::PathHelper.home instead.")
+ PathHelper.home
+ end
+
# returns a platform specific path to the user home dir if set, otherwise default to current directory.
default( :user_home ) { PathHelper.home || Dir.pwd }
diff --git a/lib/chef/knife/core/subcommand_loader.rb b/lib/chef/knife/core/subcommand_loader.rb
index ce7ef9deaa..1f59515f44 100644
--- a/lib/chef/knife/core/subcommand_loader.rb
+++ b/lib/chef/knife/core/subcommand_loader.rb
@@ -28,9 +28,15 @@ class Chef
attr_reader :chef_config_dir
attr_reader :env
- def initialize(chef_config_dir)
+ def initialize(chef_config_dir, env=nil)
@chef_config_dir = chef_config_dir
@forced_activate = {}
+
+ # Deprecated and un-used instance variable.
+ @env = env
+ unless env.nil?
+ Chef::Log.deprecation("The env argument to Chef::Knife::SubcommandLoader is deprecated. If you are using env to inject/mock HOME, consider mocking Chef::Util::PathHelper.home instead.")
+ end
end
# Load all the sub-commands