`vagrant destroy` works in "guru meditation" state

This commit is contained in:
Mitchell Hashimoto 2012-04-12 10:18:34 -07:00
parent 00c4193b43
commit 4034a2db21
2 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,8 @@
- Human friendly error if connection times out for HTTP downloads. [GH-849]
- Detect when the VirtualBox installation is incomplete and error. [GH-846]
- Use `LogLevel QUIET` for SSH to suppress the known hosts warning. [GH-847]
- VMs in the "guru meditation" state can be destroyed now using
`vagrant destroy`.
## 1.0.2 (March 25, 2012)

View File

@ -8,12 +8,16 @@ module Vagrant
end
def call(env)
if env[:vm].state == :running
if !env["force"]
current_state = env[:vm].state
if current_state == :running || current_state == :gurumeditation
# If the VM is running and we're not forcing, we can
# attempt a graceful shutdown
if current_state == :running && !env["force"]
env[:ui].info I18n.t("vagrant.actions.vm.halt.graceful")
env[:vm].guest.halt
end
# If we're not powered off now, then force it
if env[:vm].state != :poweroff
env[:ui].info I18n.t("vagrant.actions.vm.halt.force")
env[:vm].driver.halt