diff options
author | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-03-17 18:20:41 -0400 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-03-17 18:57:38 -0400 |
commit | 2b99c508b3cf53b4cba841e4688db93abec63fd3 (patch) | |
tree | f981437b3741b022782255664d54458a7a5adf3f | |
parent | 85122e7d79436c85e171509457713416eb3c2fa0 (diff) | |
download | chef-ksubrama/home_dir.tar.gz |
Deprecate things instead of removing them outright.ksubrama/home_dir
-rw-r--r-- | lib/chef/config.rb | 5 | ||||
-rw-r--r-- | lib/chef/knife/core/subcommand_loader.rb | 8 |
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 |