diff --git a/CHANGELOG.md b/CHANGELOG.md index f083300b2..08de79374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,8 @@ BUG FIXES: - Multiple machines defined in the same Vagrantfile with the same name will properly merge. - More robust hostname checking for RedHat. [GH-1566] + - Cookbook path existence for Chef is no longer an error, so that + things like librarian and berkshelf plugins work properly. [GH-1570] ## 1.1.6 (April 3, 2013) diff --git a/plugins/provisioners/chef/config/chef_solo.rb b/plugins/provisioners/chef/config/chef_solo.rb index e6c91f0a2..d19cf07d9 100644 --- a/plugins/provisioners/chef/config/chef_solo.rb +++ b/plugins/provisioners/chef/config/chef_solo.rb @@ -26,6 +26,10 @@ module VagrantPlugins @__defaulted_cookbooks_path = false end + #------------------------------------------------------------ + # Internal methods + #------------------------------------------------------------ + def finalize! @recipe_url = nil if @recipe_url == UNSET_VALUE @@ -58,18 +62,6 @@ module VagrantPlugins errors << I18n.t("vagrant.config.chef.run_list_empty") if \ !run_list || run_list.empty? - 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) - end - end - end - { "chef solo provisioner" => errors } end diff --git a/plugins/provisioners/chef/provisioner/chef_solo.rb b/plugins/provisioners/chef/provisioner/chef_solo.rb index b4cb4d013..584acbae7 100644 --- a/plugins/provisioners/chef/provisioner/chef_solo.rb +++ b/plugins/provisioners/chef/provisioner/chef_solo.rb @@ -73,7 +73,8 @@ module VagrantPlugins # Path exists on the host, setup the remote path remote_path = "#{@config.provisioning_path}/chef-solo-#{get_and_update_counter(:cookbooks_path)}" else - @logger.warn("Chef path doesn't exist, not sharing: #{local_path}") + @machine.ui.warn(I18n.t("vagrant.provisioners.chef.cookbook_folder_not_found_warning", + path: local_path.to_s)) next end else diff --git a/templates/locales/en.yml b/templates/locales/en.yml index f6015ce41..b45ab2274 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -1042,6 +1042,8 @@ en: The chef binary (either `chef-solo` or `chef-client`) was not found on the VM and is required for chef provisioning. Please verify that chef is installed and that the binary is available on the PATH. + cookbook_folder_not_found_warning: + "The cookbook path '%{path}' doesn't exist. Ignoring..." json: "Generating chef JSON and uploading..." client_key_folder: "Creating folder to hold client key..." upload_validation_key: "Uploading chef client validation key..."