summaryrefslogtreecommitdiff
path: root/lib/chef/provider/remote_file/local_file.rb
diff options
context:
space:
mode:
authoradamedx <adamed@opscode.com>2013-10-17 10:10:31 -0700
committeradamedx <adamed@opscode.com>2013-10-17 11:56:08 -0700
commit25f40030304b178f7e5518bf6da290245bc05c10 (patch)
tree1dbe3f90e0c8c920086acc4c29131e37f1ecb209 /lib/chef/provider/remote_file/local_file.rb
parent9bb1c68605f1bf2db5c67f9b20ec7e4990a4ee2f (diff)
downloadchef-25f40030304b178f7e5518bf6da290245bc05c10.tar.gz
Handle nil tempfile, ftp, http cases
Diffstat (limited to 'lib/chef/provider/remote_file/local_file.rb')
-rw-r--r--lib/chef/provider/remote_file/local_file.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/remote_file/local_file.rb b/lib/chef/provider/remote_file/local_file.rb
index 8fa26d561d..b3b2301b81 100644
--- a/lib/chef/provider/remote_file/local_file.rb
+++ b/lib/chef/provider/remote_file/local_file.rb
@@ -38,7 +38,7 @@ class Chef
tempfile = Chef::FileContentManagement::Tempfile.new(new_resource).tempfile
Chef::Log.debug("#{new_resource} staging #{uri.path} to #{tempfile.path}")
FileUtils.cp(uri.path, tempfile.path)
- tempfile.close
+ tempfile.close if tempfile
tempfile
end