vagrant/plugins/guests/freebsd/cap/halt.rb

17 lines
401 B
Ruby
Raw Normal View History

2013-04-04 18:56:42 +00:00
module VagrantPlugins
module GuestFreeBSD
module Cap
class Halt
def self.halt(machine)
begin
machine.communicate.sudo("shutdown -p now", { shell: "sh" })
2013-04-04 18:56:42 +00:00
rescue IOError
# Do nothing because SSH connection closed and it probably
# means the VM just shut down really fast.
end
end
end
end
end
end