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 19:43:04 +0100
committerThom May <thom@chef.io>2016-08-02 08:32:33 +0100
commit9e12616c410175a425552240d37a35d3b2498c24 (patch)
tree79106589c4cc9694c24b9281b60f0446d0503f2a /lib/chef/chef_fs/file_system/repository/directory.rb
parentf8dbdb18f4bcbc94d647d726ebb96ed6fcee8d4f (diff)
downloadchef-9e12616c410175a425552240d37a35d3b2498c24.tar.gz
Invalidate the cache on file creationtm/cache_invalidate
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/chef_fs/file_system/repository/directory.rb')
-rw-r--r--lib/chef/chef_fs/file_system/repository/directory.rb2
1 files changed, 2 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 dcafb308a4..328cf92b03 100644
--- a/lib/chef/chef_fs/file_system/repository/directory.rb
+++ b/lib/chef/chef_fs/file_system/repository/directory.rb
@@ -84,6 +84,7 @@ class Chef
if child.exists?
raise Chef::ChefFS::FileSystem::AlreadyExistsError.new(:create_child, child)
end
+ FileSystemCache.instance.delete!(child.file_path)
if file_contents
child.write(file_contents)
else
@@ -122,6 +123,7 @@ class Chef
raise Chef::ChefFS::FileSystem::AlreadyExistsError.new(:create_child, self)
end
begin
+ FileSystemCache.instance.delete!(file_path)
Dir.mkdir(file_path)
rescue Errno::EEXIST
raise Chef::ChefFS::FileSystem::AlreadyExistsError.new(:create_child, self)