Class: RouterosGuestPlugin::Cap::Halt

Inherits:
Object
  • Object
show all
Defined in:
lib/guest/cap/halt.rb

Class Method Summary collapse

Class Method Details

.halt(machine) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/guest/cap/halt.rb', line 4

def self.halt(machine)
    begin
        machine.ui.detail("Executing '/system shutdown' command")
        system ("vagrant ssh #{machine.name} -- '/system shutdown'")
    rescue IOError => e
        machine.ui.warn(e)
        # Ignore, this probably means connection closed because it
        # shut down.
    end
end