diff --git a/CHANGELOG.md b/CHANGELOG.md index a49fddeea..235d6334f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/lib/vagrant/action/builtin/wait_for_communicator.rb b/lib/vagrant/action/builtin/wait_for_communicator.rb index 813905d4c..4748273e7 100644 --- a/lib/vagrant/action/builtin/wait_for_communicator.rb +++ b/lib/vagrant/action/builtin/wait_for_communicator.rb @@ -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