diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2017-04-04 22:24:29 -0700 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2017-04-04 22:24:29 -0700 |
commit | 2fa4ec2392ba002c6881a2283ca65320471e4c7b (patch) | |
tree | ec78d5ee53ecda07d8732e26704fa5b3da30e177 /lib/chef/cookbook_version.rb | |
parent | f51d16101dd244046bece8721861c1aad332bca0 (diff) | |
download | chef-2fa4ec2392ba002c6881a2283ca65320471e4c7b.tar.gz |
Make root alias attributes work with the normal CookbookCompiler load behavior.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef/cookbook_version.rb')
-rw-r--r-- | lib/chef/cookbook_version.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb index a3c38e4e26..602388d0b7 100644 --- a/lib/chef/cookbook_version.rb +++ b/lib/chef/cookbook_version.rb @@ -146,7 +146,10 @@ class Chef @recipe_filenames_by_name ||= begin name_map = filenames_by_name(files_for("recipes")) root_alias = cookbook_manifest.root_files.find {|record| record[:name] == "recipe.rb" } - name_map["default"] = root_alias[:full_path] if root_alias + if root_alias + Chef::Log.error("Cookbook #{name} contains both recipe.rb and and recipes/default.rb, ignoring recipes/default.rb") if name_map["default"] + name_map["default"] = root_alias[:full_path] + end name_map end end |