Show `attempting graceful shutdown` message from action, not guest

This commit is contained in:
Mitchell Hashimoto 2012-01-07 11:44:53 -08:00
parent 0f580fd2c0
commit 7fce25e858
5 changed files with 8 additions and 13 deletions

View File

@ -9,7 +9,10 @@ module Vagrant
def call(env) def call(env)
if env[:vm].state == :running if env[:vm].state == :running
env[:vm].guest.halt if !env["force"] if !env["force"]
env[:ui].info I18n.t("vagrant.actions.vm.halt.graceful")
env[:vm].guest.halt
end
if env[:vm].state != :poweroff if env[:vm].state != :poweroff
env[:ui].info I18n.t("vagrant.actions.vm.halt.force") env[:ui].info I18n.t("vagrant.actions.vm.halt.force")

View File

@ -24,7 +24,6 @@ module Vagrant
end end
def halt def halt
vm.ui.info I18n.t("vagrant.guest.freebsd.attempting_halt")
vm.channel.sudo("shutdown -p now") vm.channel.sudo("shutdown -p now")
# Wait until the VM's state is actually powered off. If this doesn't # Wait until the VM's state is actually powered off. If this doesn't

View File

@ -20,7 +20,6 @@ module Vagrant
end end
def halt def halt
vm.ui.info I18n.t("vagrant.guest.linux.attempting_halt")
vm.channel.sudo("shutdown -h now") vm.channel.sudo("shutdown -h now")
# Wait until the VM's state is actually powered off. If this doesn't # Wait until the VM's state is actually powered off. If this doesn't

View File

@ -59,8 +59,6 @@ module Vagrant
# #
# does not exist in /etc/user_attr. TODO # does not exist in /etc/user_attr. TODO
def halt def halt
vm.ui.info I18n.t("vagrant.guest.solaris.attempting_halt")
# Wait until the VM's state is actually powered off. If this doesn't # Wait until the VM's state is actually powered off. If this doesn't
# occur within a reasonable amount of time (15 seconds by default), # occur within a reasonable amount of time (15 seconds by default),
# then simply return and allow Vagrant to kill the machine. # then simply return and allow Vagrant to kill the machine.

View File

@ -386,7 +386,10 @@ en:
the port forwarding doesn't work. If any problems occur, please try a the port forwarding doesn't work. If any problems occur, please try a
port higher than 1024. port higher than 1024.
halt: halt:
force: Forcing shutdown of VM... force: |-
Forcing shutdown of VM...
graceful: |-
Attempting graceful shutdown of VM...
host_name: host_name:
setting: "Setting host name..." setting: "Setting host name..."
import: import:
@ -627,7 +630,6 @@ en:
back the logic necessary to set this up. Please report a bug as well as the back the logic necessary to set this up. Please report a bug as well as the
box you're using. box you're using.
linux: linux:
attempting_halt: "Attempting graceful shutdown of linux..."
mount_fail: "Failed to mount shared folders. `vboxsf` was not available." mount_fail: "Failed to mount shared folders. `vboxsf` was not available."
mount_nfs_fail: |- mount_nfs_fail: |-
Mounting NFS shared folders failed. This is most often caused by the NFS Mounting NFS shared folders failed. This is most often caused by the NFS
@ -635,9 +637,3 @@ en:
that the NFS client software is properly installed, and consult any resources that the NFS client software is properly installed, and consult any resources
specific to the linux distro you're using for more information on how to specific to the linux distro you're using for more information on how to
do this. do this.
solaris:
attempting_halt: "Attempting graceful shutdown of solaris..."
freebsd:
attempting_halt: "Attempting graceful shutdown of FreeBSD..."