summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/file_system/repository/directory.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-08-01 18:10:50 +0100
committerThom May <thom@chef.io>2016-08-01 19:01:27 +0100
commitf8dbdb18f4bcbc94d647d726ebb96ed6fcee8d4f (patch)
tree7479cd04fd7e8a12deb83ffe3e65fd379ceb5556 /lib/chef/chef_fs/file_system/repository/directory.rb
parent6b88d8c1bd89f9864478fc873352c2881441dbfe (diff)
downloadchef-f8dbdb18f4bcbc94d647d726ebb96ed6fcee8d4f.tar.gz
Invalidate the file system cache on deletion
Signed-off-by: Thom May <thom@may.lt>
Diffstat (limited to 'lib/chef/chef_fs/file_system/repository/directory.rb')
-rw-r--r--lib/chef/chef_fs/file_system/repository/directory.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/chef_fs/file_system/repository/directory.rb b/lib/chef/chef_fs/file_system/repository/directory.rb
index 43f5719822..dcafb308a4 100644
--- a/lib/chef/chef_fs/file_system/repository/directory.rb
+++ b/lib/chef/chef_fs/file_system/repository/directory.rb
@@ -138,6 +138,7 @@ class Chef
raise MustDeleteRecursivelyError.new(self, $!)
end
FileUtils.rm_r(file_path)
+ FileSystemCache.instance.delete!(file_path)
else
raise Chef::ChefFS::FileSystem::NotFoundError.new(self, $!)
end
@@ -149,6 +150,10 @@ class Chef
protected
+ def write(data)
+ raise FileSystemError.new(self, nil, "attempted to write to a directory entry")
+ end
+
def make_child_entry(child_name)
raise "Not Implemented"
end