summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-11-28 22:29:33 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2018-11-28 22:30:43 -0800
commit380505cc30dbe998c6bbbf070d5d9ee8d24babce (patch)
tree1c136dc4bca3c6684284d6c8911609a42a63bbb4 /lib/chef/provider/package
parenta7f11a6a59edd052fb526da373d2447327b722c8 (diff)
downloadchef-380505cc30dbe998c6bbbf070d5d9ee8d24babce.tar.gz
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/package')
-rw-r--r--lib/chef/provider/package/snap.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/chef/provider/package/snap.rb b/lib/chef/provider/package/snap.rb
index c8cdb7f5ca..7bfb065a84 100644
--- a/lib/chef/provider/package/snap.rb
+++ b/lib/chef/provider/package/snap.rb
@@ -236,19 +236,19 @@ class Chef
# @param path [String] Path to the package on disk
# @param content_length [Integer] byte size of the snap file
def generate_multipart_form_data(snap_name, action, options, path, content_length)
- snap_options = []
- options.each do |k, v|
- snap_option = <<~SNAP_OPTION
- Content-Disposition: form-data; name="#{k}"
+ snap_options = options.map do |k, v|
+ <<~SNAP_OPTION
+ Content-Disposition: form-data; name="#{k}"
#{v}
--#{snap_name}
SNAP_OPTION
- snap_options.push(snap_option)
end
+ pp snap_options
+
multipart_form_data = <<~SNAP_S
- Host:
+ Host:
Content-Type: multipart/form-data; boundary=#{snap_name}
Content-Length: #{content_length}
@@ -257,7 +257,7 @@ class Chef
#{action}
--#{snap_name}
- #{snap_options.join("\n")}
+ #{snap_options.join("\n").chomp}
Content-Disposition: form-data; name="snap"; filename="#{path}"
<#{content_length} bytes of snap file data>