summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2012-11-27 15:53:15 -0500
committerBryan McLellan <btm@opscode.com>2012-12-25 05:52:19 -0800
commit1ac62464201985b36043b460075ceb5f32bd8f22 (patch)
tree54c0464a397009b79d84405e875d208000349737
parent2f7b2da9153b5a47757b4a778f4a5fbf57f5e6ef (diff)
downloadchef-1ac62464201985b36043b460075ceb5f32bd8f22.tar.gz
Switch template provider to FileUtils.cp
This reverses the changes made in CHEF-1396. When copying a file over an existing file, the permissions of the existing file are maintained. When moving the file the permissions of the source file are preserved. Since CHEF-1396, we now set permissions after copying (formerly moving) the file, but only do so if there are permissions specified by the user to be set.
-rw-r--r--chef/lib/chef/provider/template.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/chef/lib/chef/provider/template.rb b/chef/lib/chef/provider/template.rb
index c937b9d980..4c0989ac26 100644
--- a/chef/lib/chef/provider/template.rb
+++ b/chef/lib/chef/provider/template.rb
@@ -61,7 +61,7 @@ class Chef
description << diff_current(rendered_template.path)
converge_by(description) do
backup
- FileUtils.mv(rendered_template.path, @new_resource.path)
+ FileUtils.cp(rendered_template.path, @new_resource.path)
Chef::Log.info("#{@new_resource} updated content")
access_controls.set_all!
stat = ::File.stat(@new_resource.path)