summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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..c21f34b40f 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_homw_path is now deprecated. Please file an issue at https://github.com/chef/chef/issues if you're using it. 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..6f28f80278 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. Please file an issue at https://github.com/chef/chef/issues if you're using it. If you are using env to inject/mock HOME, consider mocking Chef::Util::PathHelper.home instead.")
+ end
end
# Load all the sub-commands