2013-07-11 01:21:06 +00:00
|
|
|
module VagrantPlugins
|
2013-08-01 01:07:04 +00:00
|
|
|
module GuestDarwin
|
2013-07-11 01:21:06 +00:00
|
|
|
module Cap
|
|
|
|
class Halt
|
|
|
|
def self.halt(machine)
|
|
|
|
begin
|
2016-06-18 19:06:20 +00:00
|
|
|
# Darwin does not support the `-p` option like the rest of the
|
|
|
|
# BSD-based guests, so it needs its own cap.
|
|
|
|
machine.communicate.sudo("/sbin/shutdown -h now")
|
2016-08-03 18:34:03 +00:00
|
|
|
rescue IOError, Vagrant::Errors::SSHDisconnected
|
2013-07-11 01:21:06 +00:00
|
|
|
# Do nothing because SSH connection closed and it probably
|
|
|
|
# means the VM just shut down really fast.
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|