diff --git a/CHANGELOG.md b/CHANGELOG.md index 032db62e2..ad5927168 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ BUG FIXES: - Action hook prepend/append will only prepend or append once. - Retry SSH on Errno::EACCES. - Show an error if an invalid network type is used. + - Don't share Chef solo folder if it doesn't exist on host. ## 1.1.4 (March 25, 2013) diff --git a/plugins/provisioners/chef/provisioner/chef_solo.rb b/plugins/provisioners/chef/provisioner/chef_solo.rb index 8363200a0..28d5ce837 100644 --- a/plugins/provisioners/chef/provisioner/chef_solo.rb +++ b/plugins/provisioners/chef/provisioner/chef_solo.rb @@ -69,8 +69,12 @@ module VagrantPlugins # Get the expanded path that the host path points to local_path = File.expand_path(path, @machine.env.root_path) - # Path exists on the host, setup the remote path - remote_path = "#{@config.provisioning_path}/chef-solo-#{get_and_update_counter(:cookbooks_path)}" + if local_path.exist? + # 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}") + end else # Path already exists on the virtual machine. Expand it # relative to where we're provisioning.