satori/satori
Samuel Stavinoha 31aa43591d add "keepalive" for remote_execute
The caller can disable this option on calls to
remote_execute() which will automatically close
the connection after successful execution.

NOTE: This is a significant logical change in the
logic of remote_execute. The previous version of
the method closed the connection *by default* each
time remote_execute was called. This changes that
behavior to be completely opposite, where the
connection will always remain open *unless* keepalive
is set to False, like so:

    # automatically closes the connection
    client.execute('echo hello', keepalive=False)

the default will keep the connection alive:

    # both commands run on the same transport instance
    client.execute('echo hello one')
    client.execute('echo hello two')

This change also adds the context managers to RemoteShell,
so that you can ensure that the connection will be closed
without having to rely on the controversial __del__(), which
has also been implemented for RemoteShell in this submission.

To use the context manager ( with statement ):

    with RemoteShell('123.123.123.2') as client:
        client.execute('echo hello')
        client.execute('echo again')

The sysinfo providers will now use the context manager
implementation. See `get_systeminfo` in ohai_solo.py
and posh_ohai.py

Change-Id: I267f7efe0f588c5bdc83b419c01997a69378c308
Implements: blueprint remain-open-post-remote-execute
2014-08-20 20:28:40 +00:00
..
common fix tests and test requirements 2014-07-22 23:07:38 +00:00
contrib Move serviceinstall to satori 2014-08-01 17:29:34 +01:00
formats Implement New Discovery Schema 2014-05-07 15:25:05 -05:00
sysinfo add "keepalive" for remote_execute 2014-08-20 20:28:40 +00:00
tests add "keepalive" for remote_execute 2014-08-20 20:28:40 +00:00
__init__.py Adds Windows Support to satori discovery 2014-07-29 03:14:22 -05:00
bash.py add "keepalive" for remote_execute 2014-08-20 20:28:40 +00:00
discovery.py Adds Windows Support to satori discovery 2014-07-29 03:14:22 -05:00
dns.py Implement New Discovery Schema 2014-05-07 15:25:05 -05:00
errors.py Unittests for satori-localhost implementation 2014-05-05 22:49:21 -05:00
serviceinstall.py Move serviceinstall to satori 2014-08-01 17:29:34 +01:00
shell.py Implement New Discovery Schema 2014-05-07 15:25:05 -05:00
smb.py Move serviceinstall to satori 2014-08-01 17:29:34 +01:00
ssh.py add "keepalive" for remote_execute 2014-08-20 20:28:40 +00:00
tunnel.py Move serviceinstall to satori 2014-08-01 17:29:34 +01:00
utils.py Move serviceinstall to satori 2014-08-01 17:29:34 +01:00