summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteven Danna <steve@chef.io>2015-10-22 10:53:42 +0100
committerSteven Danna <steve@chef.io>2015-10-23 12:34:58 +0100
commitb036d1542c10a6a4c0910b96a27404735134055a (patch)
tree6a4c8fb64a9fcaae2810c5f1d45298deb61756c6 /lib
parente98d4dafc8121e1adeff580bf5dc15c971e3618f (diff)
downloadchef-b036d1542c10a6a4c0910b96a27404735134055a.tar.gz
Allow downloading of root_files in a chef repositoryssd/download-root-files
A FileSystemEntry with a nil parent is a "root directory" and thus should exists so long as its filesystem path exists. This was preventing the download of files such as invitation.json whose parent directory is a root directory.
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/chef_fs/file_system/file_system_entry.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/chef_fs/file_system/file_system_entry.rb b/lib/chef/chef_fs/file_system/file_system_entry.rb
index 8611aa2e0f..478631eac2 100644
--- a/lib/chef/chef_fs/file_system/file_system_entry.rb
+++ b/lib/chef/chef_fs/file_system/file_system_entry.rb
@@ -83,7 +83,7 @@ class Chef
end
def exists?
- File.exists?(file_path) && parent.can_have_child?(name, dir?)
+ File.exists?(file_path) && (parent.nil? || parent.can_have_child?(name, dir?))
end
def read