From e107202050e794bec3ed6103952213b855a6a3cd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 17 May 2014 11:55:12 -0700 Subject: [PATCH] core: WaitForCommunicator always asks for state This forces global-status to be up-to-date typically --- CHANGELOG.md | 2 ++ lib/vagrant/action/builtin/wait_for_communicator.rb | 12 +----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 895a09182..1487bc5ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ IMPROVEMENTS: BUG FIXES: + - core: Provider plugins more easily are compatible with global-status + and should show less stale data. [GH-3808] - commands/package: Package with `--base` for VirtualBox doesn't crash. [GH-3827] - provisioners/puppet: Fix setting facter vars with Windows diff --git a/lib/vagrant/action/builtin/wait_for_communicator.rb b/lib/vagrant/action/builtin/wait_for_communicator.rb index 0890fca47..dcf4d9869 100644 --- a/lib/vagrant/action/builtin/wait_for_communicator.rb +++ b/lib/vagrant/action/builtin/wait_for_communicator.rb @@ -21,16 +21,6 @@ module Vagrant states_thr = Thread.new do Thread.current[:result] = true - # If we aren't caring about states, just basically put this - # thread to sleep because it'll get killed later. - if !@states - while true - sleep 300 - end - - next - end - # Otherwise, periodically verify the VM isn't in a bad state. while true state = env[:machine].state.id @@ -39,7 +29,7 @@ module Vagrant Thread.current[:last_known_state] = state # Check if we have the proper state so we can break out - if !@states.include?(state) + if @states && !@states.include?(state) Thread.current[:result] = false break end