diff options
-rw-r--r-- | lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb b/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb index b8ec5f8524..eb793d5e87 100644 --- a/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +++ b/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb @@ -69,7 +69,14 @@ class Chef def exists? if @exists.nil? begin - @exists = parent.children.any? { |child| child.api_child_name == api_child_name } + rest.get(api_path) + @exists = true + rescue Net::HTTPServerException => e + if e.response.code == "404" + @exists = false + else + raise + end rescue Chef::ChefFS::FileSystem::NotFoundError @exists = false end |