summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook_uploader.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2017-04-24 18:07:10 +0100
committerThom May <thom@chef.io>2017-04-24 20:15:23 +0100
commitef179624487c17862c6b76b3240b34ebef722a92 (patch)
tree73853e1a14fb16cb2a16d20b1c52ee6f609e05c6 /lib/chef/cookbook_uploader.rb
parent8bfe9fd510631b5ebfd2ba2d5db86af808dbe310 (diff)
downloadchef-tm/lazy.tar.gz
Fix lazy loading for cookbook filestm/lazy
This introduces a new File class that allows us to clean up manifest and version a bit. Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/cookbook_uploader.rb')
-rw-r--r--lib/chef/cookbook_uploader.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/cookbook_uploader.rb b/lib/chef/cookbook_uploader.rb
index cc74644f27..3ffbf13eb9 100644
--- a/lib/chef/cookbook_uploader.rb
+++ b/lib/chef/cookbook_uploader.rb
@@ -120,7 +120,7 @@ class Chef
# but we need the base64 encoding for the content-md5
# header
checksum64 = Base64.encode64([checksum].pack("H*")).strip
- file_contents = File.open(file, "rb") { |f| f.read }
+ file_contents = File.open(file[:full_path], "rb") { |f| f.read }
# Custom headers. 'content-type' disables JSON serialization of the request body.
headers = { "content-type" => "application/x-binary", "content-md5" => checksum64, "accept" => "application/json" }