diff options
author | Thom May <thom@chef.io> | 2016-08-01 19:43:04 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-08-02 08:32:33 +0100 |
commit | 9e12616c410175a425552240d37a35d3b2498c24 (patch) | |
tree | 79106589c4cc9694c24b9281b60f0446d0503f2a /lib | |
parent | f8dbdb18f4bcbc94d647d726ebb96ed6fcee8d4f (diff) | |
download | chef-9e12616c410175a425552240d37a35d3b2498c24.tar.gz |
Invalidate the cache on file creationtm/cache_invalidate
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/chef_fs/file_system/repository/directory.rb | 2 |
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) |