Skip to content

Commit

Permalink
core: Report the proper invalid state when waiting for the guest mach…
Browse files Browse the repository at this point in the history
…ine to be ready
  • Loading branch information
fgrehm committed Sep 14, 2013
1 parent 7b44033 commit 87f8bd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 3 additions & 1 deletion lib/vagrant/action/builtin/wait_for_communicator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def call(env)
# 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
Expand All @@ -51,7 +53,7 @@ def call(env)
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
Expand Down

3 comments on commit 87f8bd8

@fgrehm
Copy link
Contributor Author

@fgrehm fgrehm commented on 87f8bd8 Sep 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitchellh this is related to fgrehm/vagrant-lxc#142 reported by @tripledes, if you pay attention to the message, it reports that running is an invalid state along with a message saying it is invalid.

@fgrehm
Copy link
Contributor Author

@fgrehm fgrehm commented on 87f8bd8 Sep 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/saying it is invalid/saying it is valid/

@mitchellh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks.

Please sign in to comment.