diff --git a/CHANGELOG.md b/CHANGELOG.md index 04c812f56..4492a1ed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ IMPROVEMENTS: BUG FIXES: - core: Hostnames can be one character. [GH-3713] + - core: Don't lock machines on SSH actions. [GH-3664] ## 1.6.1 (May 7, 2014) diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 7f2862ada..1438798cd 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -151,8 +151,14 @@ module Vagrant # Create a deterministic ID for this machine id = Digest::MD5.hexdigest("#{@env.root_path}#{@name}") + # We only lock if we're not executing an SSH action. In the future + # we will want to do more fine-grained unlocking in actions themselves + # but for a 1.6.2 release this will work. + locker = Proc.new { |*args| yield } + locker = @env.method(:lock) if !name.to_s.start_with?("ssh") + # Lock this machine for the duration of this action - @env.lock("machine-action-#{id}") do + locker.call("machine-action-#{id}") do # Get the callable from the provider. callable = @provider.action(name)