summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authortylercloke <tyler@opscode.com>2012-11-02 14:57:34 -0700
committertylercloke <tyler@opscode.com>2012-11-05 16:07:55 -0800
commit926726fb40f738fa7d0c1c7944c8c3350a1694e8 (patch)
treefc6b9a0dfb59509372eab5754508c1c155e651a6 /lib/chef/provider
parent1fe6f9a838e9383931dc920cdfdbe47ffbd4e2ae (diff)
downloadchef-926726fb40f738fa7d0c1c7944c8c3350a1694e8.tar.gz
Fixed CHEF-3564 so that remote_directory
is not longer updated_by_last_action on every run by only putting converge_by blocks in places where remote_dir would directly execute code.
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/remote_directory.rb24
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/chef/provider/remote_directory.rb b/lib/chef/provider/remote_directory.rb
index dee383f763..5b6348980c 100644
--- a/lib/chef/provider/remote_directory.rb
+++ b/lib/chef/provider/remote_directory.rb
@@ -39,22 +39,18 @@ class Chef
name !~ /(?:^|#{Regexp.escape(::File::SEPARATOR)})\.\.?$/
end)
- converge_by("Create managed files in directory") do
- files_to_transfer.each do |cookbook_file_relative_path|
- create_cookbook_file(cookbook_file_relative_path)
- # the file is removed from the purge list
- files_to_purge.delete(::File.join(@new_resource.path, cookbook_file_relative_path))
- # parent directories are also removed from the purge list
- directories=::File.dirname(::File.join(@new_resource.path, cookbook_file_relative_path)).split(::File::SEPARATOR)
- for i in 0..directories.length-1
- files_to_purge.delete(::File.join(directories[0..i]))
- end
- end
- end
- converge_by("Purge unmanaged files from directory") do
- purge_unmanaged_files(files_to_purge)
+ files_to_transfer.each do |cookbook_file_relative_path|
+ create_cookbook_file(cookbook_file_relative_path)
+ # the file is removed from the purge list
+ files_to_purge.delete(::File.join(@new_resource.path, cookbook_file_relative_path))
+ # parent directories are also removed from the purge list
+ directories=::File.dirname(::File.join(@new_resource.path, cookbook_file_relative_path)).split(::File::SEPARATOR)
+ for i in 0..directories.length-1
+ files_to_purge.delete(::File.join(directories[0..i]))
+ end
end
+ purge_unmanaged_files(files_to_purge)
end
def action_create_if_missing