diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-12-03 11:29:38 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-12-03 11:35:43 -0800 |
commit | 5002cbbee1135195d8dcb04f5509ab98cfb9169a (patch) | |
tree | 6ee0ea53cc51d7fb1ce11130f92a90bb98a28646 /lib/chef/workstation_config_loader.rb | |
parent | a00ed4b198ea25e14d6b7fe861b401a32352e9fa (diff) | |
download | chef-5002cbbee1135195d8dcb04f5509ab98cfb9169a.tar.gz |
Fix knife plugin path searching
Unreleased Chef 12.0.0 bug caught in testing where only the searching
upwards from PWD to find .chef in order to get the plugin path for knife
was busted. The chef_config_dir was being used before load_config was
being called, so it was nil, which broke finding knife plugins. This
was fixed by adding some lazy initialization of the config_loader object
itself and the chef_config_dir.
The reset_config_loader! is added entirely to reset the global state for unit
testing. This whole class is a bit horrible and needs to have all its
global state removed from it, class methods removed, class ivars and the
class-variable-in-a-class-method-for-inheritance-lolwut needs to be removed.
Unfortunately, that requires some delicate surgery because Chef::Knife
gets used as a public API, and is beyond the scope of gettting Chef 12
shipped.
Diffstat (limited to 'lib/chef/workstation_config_loader.rb')
-rw-r--r-- | lib/chef/workstation_config_loader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/workstation_config_loader.rb b/lib/chef/workstation_config_loader.rb index 6715d4eec2..dd02ad9a66 100644 --- a/lib/chef/workstation_config_loader.rb +++ b/lib/chef/workstation_config_loader.rb @@ -25,7 +25,7 @@ class Chef class WorkstationConfigLoader # Path to a config file requested by user, (e.g., via command line option). Can be nil - attr_reader :explicit_config_file + attr_accessor :explicit_config_file # TODO: initialize this with a logger for Chef and Knife def initialize(explicit_config_file, logger=nil) |