summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-07-29 11:14:57 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-07-29 11:14:57 -0700
commitccfa237afe8609dc34316c68de715c89240b9230 (patch)
treefbfaa372c74ec3cabe1ec9f4d833f7ea54eb9890
parent221b4715b645fdcf8adbdfc6577e1d7f6871ac2c (diff)
downloadchef-ccfa237afe8609dc34316c68de715c89240b9230.tar.gz
generate content up front
-rw-r--r--lib/chef/provider/file.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 5b7ae0f75d..2988902f48 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -125,6 +125,7 @@ class Chef
end
def action_create
+ do_generate_content
do_unlink
do_create_file
do_contents_changes
@@ -302,6 +303,10 @@ class Chef
end
end
+ def do_generate_content
+ tempfile
+ end
+
def do_unlink
if @new_resource.force_unlink
if needs_unlinking?
@@ -404,7 +409,7 @@ class Chef
end
def tempfile
- content.tempfile
+ @tempfile ||= content.tempfile
end
def short_cksum(checksum)