summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2017-04-10 16:58:43 -0700
committerNoah Kantrowitz <noah@coderanger.net>2017-04-10 16:58:43 -0700
commit2b62d01b854df218ac41e4549f2e7b702c84052b (patch)
tree0bbd9431e0ab5ac324f4e12fcda27da141fa8a3e
parent3997dbf3efb9850342121497aa27f1964a22b394 (diff)
downloadchef-2b62d01b854df218ac41e4549f2e7b702c84052b.tar.gz
Fix https://github.com/chef/chef/issues/6044 by ensuring all segments exist in the manifest.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
-rw-r--r--lib/chef/cookbook/manifest_v0.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/cookbook/manifest_v0.rb b/lib/chef/cookbook/manifest_v0.rb
index d818f3072f..400b960dfc 100644
--- a/lib/chef/cookbook/manifest_v0.rb
+++ b/lib/chef/cookbook/manifest_v0.rb
@@ -54,6 +54,11 @@ class Chef
end
end
end
+ # Ensure all segments are set to [] if they don't exist.
+ # See https://github.com/chef/chef/issues/6044
+ COOKBOOK_SEGMENTS.each do |segment|
+ result[segment] ||= []
+ end
result.merge({ "frozen?" => manifest.frozen_version?, "chef_type" => "cookbook_version" })
end