add win_reboot action

also includes WinRM connection plugin change to support connection reset
This commit is contained in:
nitzmahone 2016-02-06 00:00:07 -08:00
parent 040893a677
commit 336b1ae84b
2 changed files with 145 additions and 0 deletions

View file

@ -213,6 +213,11 @@ class Connection(ConnectionBase):
self._connected = True
return self
def _reset(self): # used by win_reboot (and any other action that might need to bounce the state)
self.protocol = None
self.shell_id = None
self._connect()
def exec_command(self, cmd, in_data=None, sudoable=True):
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
cmd_parts = shlex.split(to_bytes(cmd), posix=False)