summaryrefslogtreecommitdiff
path: root/lib/chef/file_content_management
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-06-04 12:55:14 -0700
committerdanielsdeleo <dan@opscode.com>2013-06-06 16:47:45 -0700
commitc4631816132fcfefaba3d123a1d0dfe8bc2866bb (patch)
treee3609a4277510e9e6a7fc2c306301e44df532071 /lib/chef/file_content_management
parent1a049040755865a38fc8969e353e8e712dec27e9 (diff)
downloadchef-c4631816132fcfefaba3d123a1d0dfe8bc2866bb.tar.gz
only stat() once to get desired attributes
Diffstat (limited to 'lib/chef/file_content_management')
-rw-r--r--lib/chef/file_content_management/deploy/mv_unix.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/file_content_management/deploy/mv_unix.rb b/lib/chef/file_content_management/deploy/mv_unix.rb
index 9baaa9906d..758c594e50 100644
--- a/lib/chef/file_content_management/deploy/mv_unix.rb
+++ b/lib/chef/file_content_management/deploy/mv_unix.rb
@@ -37,9 +37,10 @@ class Chef
def deploy(src, dst)
# we are only responsible for content so restore the dst files perms
Chef::Log.debug("reading modes from #{dst} file")
- mode = ::File.stat(dst).mode & 07777
- uid = ::File.stat(dst).uid
- gid = ::File.stat(dst).gid
+ stat = ::File.stat(dst)
+ mode = stat.mode & 07777
+ uid = stat.uid
+ gid = stat.gid
Chef::Log.debug("applying mode = #{mode.to_s(8)}, uid = #{uid}, gid = #{gid} to #{src}")