Merge pull request #318 from rtkrruvinskiy/lock_race
Work around WaitForCommunicator lock race condition
This commit is contained in:
commit
b4a642bc8a
2 changed files with 5 additions and 10 deletions
|
@ -197,14 +197,9 @@ module Vagrant
|
|||
# is expected to be put into the `:machine_ip` key.
|
||||
def self.action_fetch_ip
|
||||
Builder.new.tap do |b|
|
||||
b.use Builtin::ConfigValidate
|
||||
b.use Builtin::Call, Builtin::IsState, :running do |env, b2|
|
||||
if env[:result]
|
||||
b.use Builtin::Call, Builtin::ConfigValidate do |env, b2|
|
||||
b2.use FetchIpWithLxcAttach if env[:machine].provider.driver.supports_attach?
|
||||
b2.use FetchIpFromDnsmasqLeases
|
||||
else
|
||||
b2.use Builtin::Message, I18n.t("vagrant_lxc.messages.not_running")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -64,9 +64,9 @@ module Vagrant
|
|||
|
||||
# Returns the SSH info for accessing the Container.
|
||||
def ssh_info
|
||||
# If the Container is not created then we cannot possibly SSH into it, so
|
||||
# If the Container is not running then we cannot possibly SSH into it, so
|
||||
# we return nil.
|
||||
return nil if state == :not_created
|
||||
return nil if state.id != :running
|
||||
|
||||
# Run a custom action called "fetch_ip" which does what it says and puts
|
||||
# the IP found into the `:machine_ip` key in the environment.
|
||||
|
|
Loading…
Reference in a new issue