diff options
-rw-r--r-- | lib/chef/knife/list.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/chef/knife/list.rb b/lib/chef/knife/list.rb index 6f314eb86d..7e19a553bc 100644 --- a/lib/chef/knife/list.rb +++ b/lib/chef/knife/list.rb @@ -104,6 +104,18 @@ class Chef begin children = result.children.sort_by { |child| child.name } rescue Chef::ChefFS::FileSystem::NotFoundError => e + begin + rest.get("/clients/#{Chef::Config[:client_name]}") + rescue Net::HTTPServerException => e + if e.response.class == Net::HTTPNotFound + require "json" + begin + JSON.load(e.response.body()) + rescue JSON::ParserError + raise Chef::Exceptions::NotAChefServerException + end + end + end ui.error "#{format_path(e.entry)}: No such file or directory" return [] end |