class Dopi::Command::Winrm::Reboot

Public Instance Methods

run() click to toggle source
Calls superclass method Dopi::Command::Winrm::WaitForLogin#run
# File lib/dopi/command/winrm/reboot.rb, line 10
def run
  winrm_powershell_command('shutdown /r /f /t 0')
  connected = true
  while connected
    begin
      @node.reset_address(port)
      @node.address(port)
    rescue Dopi::NodeConnectionError
      connected = false
    end
    if connected
      sleep 1
      raise GracefulExit if signals[:stop]
      log(:info, "Still able to login, waiting for shutdown")
    end
  end
  log(:info, "Node is down, starting to check for login")
  super
end