diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/knife/core/hashed_command_loader.rb | 5 | ||||
-rw-r--r-- | lib/chef/knife/rehash.rb | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/knife/core/hashed_command_loader.rb b/lib/chef/knife/core/hashed_command_loader.rb index dee9e973fb..1165af6eb2 100644 --- a/lib/chef/knife/core/hashed_command_loader.rb +++ b/lib/chef/knife/core/hashed_command_loader.rb @@ -48,10 +48,11 @@ class Chef # eventually get an error and the user will need to rehash - instead, lets just # print out 1 error here telling them to rehash errors = {} - commands.collect {|k, v| v}.flatten.each do |command| + commands.collect { |k, v| v }.flatten.each do |command| paths = manifest[KEY]["plugins_paths"][command] if paths && paths.is_a?(Array) - if paths.all? {|sc| !File.exists?(sc)} + # It is only an error if all the paths don't exist + if paths.all? { |sc| !File.exists?(sc) } errors[command] = paths end end diff --git a/lib/chef/knife/rehash.rb b/lib/chef/knife/rehash.rb index 8ede30643a..79286368f8 100644 --- a/lib/chef/knife/rehash.rb +++ b/lib/chef/knife/rehash.rb @@ -38,7 +38,7 @@ class Chef # The subcommand_loader for this knife command should _always_ be the GemGlobLoader. The GemGlobLoader loads # plugins from disc and ensures the hash we write is always correct. By this point it should also already have # loaded plugins and `load_commands` shouldn't have an effect. - Chef::Knife::subcommand_loader.load_commands + Chef::Knife.subcommand_loader.load_commands end def generate_hash |