diff options
author | Thom May <thom@chef.io> | 2017-04-11 11:39:13 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2017-04-11 11:39:13 +0100 |
commit | 896c94c70023406e88eb3efaa3c680ab4cc17646 (patch) | |
tree | c78dbc50101e91752e8e407cab1270464d3a154e | |
parent | ccfed2a1edfc53faa16319b11359d7ece47cb556 (diff) | |
download | chef-896c94c70023406e88eb3efaa3c680ab4cc17646.tar.gz |
ensure all required fields are preserved in ManifestV0
Signed-off-by: Thom May <thom@chef.io>
-rw-r--r-- | lib/chef/cookbook/manifest_v0.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/cookbook/manifest_v0.rb b/lib/chef/cookbook/manifest_v0.rb index 400b960dfc..fd2d62a6d4 100644 --- a/lib/chef/cookbook/manifest_v0.rb +++ b/lib/chef/cookbook/manifest_v0.rb @@ -27,13 +27,14 @@ class Chef COOKBOOK_SEGMENTS = %w{ resources providers recipes definitions libraries attributes files templates root_files } def self.from_hash(hash) - response = Mash.new + response = Mash.new(hash) response[:all_files] = COOKBOOK_SEGMENTS.inject([]) do |memo, segment| next memo if hash[segment].nil? || hash[segment].empty? hash[segment].each do |file| file["name"] = "#{segment}/#{file["name"]}" unless segment == "root_files" memo << file end + response.delete(segment) memo end response |