diff --git a/CHANGELOG.md b/CHANGELOG.md index 1902afb25..8eb0c6324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## 1.1.2 (unreleased) +BUG FIXES: + - When not specifying a cookbooks_path for chef-solo, an error won't + be shown if "cookbooks" folder is missing. ## 1.1.1 (March 18, 2013) diff --git a/plugins/provisioners/chef/config/chef_solo.rb b/plugins/provisioners/chef/config/chef_solo.rb index 02e8837e9..3bc2c6c15 100644 --- a/plugins/provisioners/chef/config/chef_solo.rb +++ b/plugins/provisioners/chef/config/chef_solo.rb @@ -22,11 +22,14 @@ module VagrantPlugins @encrypted_data_bag_secret = UNSET_VALUE @encrypted_data_bag_secret_key_path = UNSET_VALUE @nfs = UNSET_VALUE + + @__defaulted_cookbooks_path = false end def finalize! if @cookbooks_path == UNSET_VALUE @cookbooks_path = [[:host, "cookbooks"], [:vm, "cookbooks"]] + @__defaulted_cookbooks_path = true end @data_bags_path = [] if @data_bags_path == UNSET_VALUE @@ -52,13 +55,15 @@ module VagrantPlugins errors << I18n.t("vagrant.config.chef.run_list_empty") if \ !run_list || run_list.empty? - @cookbooks_path.each do |type, path| - next if type != :host - expanded_path = File.expand_path(path, machine.env.root_path) + if !@__defaulted_cookbooks_path + @cookbooks_path.each do |type, path| + next if type != :host + expanded_path = File.expand_path(path, machine.env.root_path) - if !File.exist?(expanded_path) - errors << I18n.t("vagrant.config.chef.cookbooks_path_missing", - :path => expanded_path) + if !File.exist?(expanded_path) + errors << I18n.t("vagrant.config.chef.cookbooks_path_missing", + :path => expanded_path) + end end end