From 300b9c910954bf0e6beed0888e121473639ef2c8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 9 Jul 2015 14:03:38 -0600 Subject: [PATCH] provisioners/chef: don't check existing set, unique ID [GH-5199] --- .../provisioners/chef/provisioner/chef_solo.rb | 12 +++++++++++- .../provisioners/chef/provisioner/chef_zero.rb | 17 ++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/plugins/provisioners/chef/provisioner/chef_solo.rb b/plugins/provisioners/chef/provisioner/chef_solo.rb index 18bdc9e1d..8f38ad424 100644 --- a/plugins/provisioners/chef/provisioner/chef_solo.rb +++ b/plugins/provisioners/chef/provisioner/chef_solo.rb @@ -125,13 +125,23 @@ module VagrantPlugins # If this folder already exists, then we don't share it, it means # it was already put down on disk. + # + # NOTE: This is currently commented out because it was causing + # major bugs (GH-5199). We will investigate why this is in more + # detail for 1.8.0, but we wanted to fix this in a patch release + # and this was the hammer that did that. +=begin if existing_set.include?(remote_path) @logger.debug("Not sharing #{local_path}, exists as #{remote_path}") next end +=end + + key = Digest::MD5.hexdigest(remote_path) + key = key[0..8] opts = {} - opts[:id] = "v-#{prefix}-#{self.class.get_and_update_counter(:shared_folder)}" + opts[:id] = "v-#{prefix}-#{key}" opts[:type] = @config.synced_folder_type if @config.synced_folder_type root_config.vm.synced_folder(local_path, remote_path, opts) diff --git a/plugins/provisioners/chef/provisioner/chef_zero.rb b/plugins/provisioners/chef/provisioner/chef_zero.rb index 1a63be73f..53b5096ee 100644 --- a/plugins/provisioners/chef/provisioner/chef_zero.rb +++ b/plugins/provisioners/chef/provisioner/chef_zero.rb @@ -84,8 +84,9 @@ module VagrantPlugins key = Digest::MD5.hexdigest(local_path) remote_path = "#{@config.provisioning_path}/#{key}" else - @machine.ui.warn(I18n.t("vagrant.provisioners.chef.cookbook_folder_not_found_warning", - path: local_path.to_s)) + @machine.ui.warn(I18n.t( + "vagrant.provisioners.chef.cookbook_folder_not_found_warning", + path: local_path.to_s)) next end else @@ -125,13 +126,23 @@ module VagrantPlugins # If this folder already exists, then we don't share it, it means # it was already put down on disk. + # + # NOTE: This is currently commented out because it was causing + # major bugs (GH-5199). We will investigate why this is in more + # detail for 1.8.0, but we wanted to fix this in a patch release + # and this was the hammer that did that. +=begin if existing_set.include?(remote_path) @logger.debug("Not sharing #{local_path}, exists as #{remote_path}") next end +=end + + key = Digest::MD5.hexdigest(remote_path) + key = key[0..8] opts = {} - opts[:id] = "v-#{prefix}-#{self.class.get_and_update_counter(:shared_folder)}" + opts[:id] = "v-#{prefix}-#{key}" opts[:type] = @config.synced_folder_type if @config.synced_folder_type root_config.vm.synced_folder(local_path, remote_path, opts)