summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook_site_streaming_uploader.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2017-03-21 10:31:40 +0000
committerThom May <thom@chef.io>2017-04-04 07:18:09 +0100
commit8f62f18a24e3213ef4b2f13a5abf0135bf6c2429 (patch)
tree7e3073c1b9a7aeb1fd54b08a191ad3bfcf0674f0 /lib/chef/cookbook_site_streaming_uploader.rb
parente3b9e67a880bcd658517f90a6add837c0e026798 (diff)
downloadchef-8f62f18a24e3213ef4b2f13a5abf0135bf6c2429.tar.gz
RFC 67: Remove cookbook segments
This implements RFC 67, which removes cookbook segments, and moves to a single list of all the files contained in a cookbook. This allows us to move forward with better audit modes and also proper shipping of ohai plugins. Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/cookbook_site_streaming_uploader.rb')
-rw-r--r--lib/chef/cookbook_site_streaming_uploader.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/chef/cookbook_site_streaming_uploader.rb b/lib/chef/cookbook_site_streaming_uploader.rb
index c0e85ff984..1641992eac 100644
--- a/lib/chef/cookbook_site_streaming_uploader.rb
+++ b/lib/chef/cookbook_site_streaming_uploader.rb
@@ -43,15 +43,13 @@ class Chef
FileUtils.mkdir_p(tmp_cookbook_dir)
Chef::Log.debug("Staging at #{tmp_cookbook_dir}")
checksums_to_on_disk_paths = cookbook.checksums
- Chef::CookbookVersion::COOKBOOK_SEGMENTS.each do |segment|
- cookbook.manifest[segment].each do |manifest_record|
- path_in_cookbook = manifest_record[:path]
- on_disk_path = checksums_to_on_disk_paths[manifest_record[:checksum]]
- dest = File.join(tmp_cookbook_dir, cookbook.name.to_s, path_in_cookbook)
- FileUtils.mkdir_p(File.dirname(dest))
- Chef::Log.debug("Staging #{on_disk_path} to #{dest}")
- FileUtils.cp(on_disk_path, dest)
- end
+ cookbook.each_file do |manifest_record|
+ path_in_cookbook = manifest_record[:path]
+ on_disk_path = checksums_to_on_disk_paths[manifest_record[:checksum]]
+ dest = File.join(tmp_cookbook_dir, cookbook.name.to_s, path_in_cookbook)
+ FileUtils.mkdir_p(File.dirname(dest))
+ Chef::Log.debug("Staging #{on_disk_path} to #{dest}")
+ FileUtils.cp(on_disk_path, dest)
end
# First, generate metadata