core: don't lock machines on SSH access

This commit is contained in:
Mitchell Hashimoto 2014-05-08 09:55:23 -07:00
parent c724130a4d
commit 86aef2249b
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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)