diff options
author | Alex Pop <al3xpop@gmail.com> | 2015-07-04 02:02:28 +0100 |
---|---|---|
committer | Steven Danna <steve@chef.io> | 2015-08-25 17:30:22 +0100 |
commit | 7d7da108c9f53be59547c4762e5ef42422603257 (patch) | |
tree | ffc1ea163ed6cea0625c3c5c2d7b363627275fa4 | |
parent | d243fe838053fc6d142847f9fbf62d75395614d1 (diff) | |
download | chef-7d7da108c9f53be59547c4762e5ef42422603257.tar.gz |
Guard against uninstalled but hashed knife plugin
-rw-r--r-- | lib/chef/knife/core/hashed_command_loader.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/knife/core/hashed_command_loader.rb b/lib/chef/knife/core/hashed_command_loader.rb index 6729e59bb0..9d129acf45 100644 --- a/lib/chef/knife/core/hashed_command_loader.rb +++ b/lib/chef/knife/core/hashed_command_loader.rb @@ -56,7 +56,12 @@ class Chef false else paths.each do |sc| - Kernel.load sc + if File.exists?(sc) + Kernel.load sc + else + puts "Plugin '#{sc}' is missing for subcommand '#{subcommand_for_args(args)}'. Please rehash to update the subcommands cache." + return false + end end true end |