diff options
author | danielsdeleo <dan@opscode.com> | 2014-01-22 17:00:57 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2014-01-22 17:00:57 -0800 |
commit | f2061f400f3a8802ca94ee98cd26b32502fd9cbb (patch) | |
tree | ab782a43c87b129529fbb63f97daab7ef05c77d9 /lib | |
parent | c52960f3cea72c65068ab07cdeea602b4821d322 (diff) | |
download | chef-f2061f400f3a8802ca94ee98cd26b32502fd9cbb.tar.gz |
Fix incompatibilites between node expansion and policyfile
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/policy_builder/policyfile.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb index 9a544e6dc9..3c89f810fa 100644 --- a/lib/chef/policy_builder/policyfile.rb +++ b/lib/chef/policy_builder/policyfile.rb @@ -195,6 +195,8 @@ class Chef def apply_policyfile_attributes node.run_list(run_list) + node.automatic_attrs[:roles] = [] + node.automatic_attrs[:recipes] = run_list_expansion_ish.recipes node.attributes.role_default = policy["default_attributes"] node.attributes.role_override = policy["override_attributes"] end @@ -302,6 +304,11 @@ class Chef def manifest_for(cookbook_name, lock_data) xyz_version = lock_data["dotted_decimal_identifier"] http_api.get("cookbooks/#{cookbook_name}/#{xyz_version}") + rescue Exception => e + message = "Error loading cookbook #{cookbook_name} at version #{xyz_version}: #{e.class} - #{e.message}" + err = Chef::Exceptions::CookbookNotFound.new(message) + err.set_backtrace(e.backtrace) + raise err end def cookbook_locks |