core: Report the proper invalid state when waiting for the guest machine to be ready

This commit is contained in:
Fabio Rehm 2013-09-14 14:35:50 -03:00
parent 7b440339f3
commit 87f8bd8c23
2 changed files with 5 additions and 1 deletions

View File

@ -7,6 +7,8 @@ IMPROVEMENTS:
BUG FIXES:
- core: Report the proper invalid state when waiting for the guest machine
to be ready
- core: `Guest#capability?` now works with strings as well
- core: Fix NoMethodError in the new `Vagrant.has_plugin?` method [GH-2189]
- hosts/arch: NFS exporting works properly, no exceptions. [GH-2161]

View File

@ -34,6 +34,8 @@ module Vagrant
# Otherwise, periodically verify the VM isn't in a bad state.
while true
state = env[:machine].provider.state.id
# Used to report invalid states
Thread.current[:last_known_state] = state
if !@states.include?(state)
Thread.current[:result] = false
break
@ -51,7 +53,7 @@ module Vagrant
if !states_thr[:result]
raise Errors::VMBootBadState,
valid: @states.join(", "),
invalid: env[:machine].provider.state.id
invalid: states_thr[:last_known_state]
end
# If it didn't boot, raise an error