summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2016-03-02 12:19:48 -0700
committertyler-ball <tyleraball@gmail.com>2016-03-04 10:50:59 -0700
commit68b188dbd933a5ec97e5540d22541c57480bdad3 (patch)
tree5c4e9ba97d90a855cde83b5ff9ea3b5d485cd7f8 /lib
parent3cda9adee23631665f6b5e7435eac09673876ba8 (diff)
downloadchef-68b188dbd933a5ec97e5540d22541c57480bdad3.tar.gz
Adding specs for rehash update
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/knife/core/hashed_command_loader.rb5
-rw-r--r--lib/chef/knife/rehash.rb2
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