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

17 lines
383 B
Ruby
Raw Normal View History

module VagrantPlugins
module GuestDarwin
module Cap
class Halt
def self.halt(machine)
begin
machine.communicate.sudo("shutdown -h now")
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