31aa43591d
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 |
||
---|---|---|
.. | ||
__init__.py | ||
test_bash.py | ||
test_common_logging.py | ||
test_common_templating.py | ||
test_dns.py | ||
test_formats_text.py | ||
test_shell.py | ||
test_ssh.py | ||
test_sysinfo_ohai_solo.py | ||
test_utils.py | ||
utils.py |