mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
adds two new plugins that use ansible-connection for persistence (#18572)
* adds new connection plugin `network_cli` which builds on paramiko * adds new plugin `terminal` used for manipulating network_cli terminals * adds new field to play_context `network_os` settable as ansible_network_os This commit adds the plugins necesary to establish a persistent cli connection to network devices of ssh. It builds on the paramiko connection plugin to create a shell environment that will persistent through ansible-connection. The `newtork_cli` plugin then uses the network_os in the instance of PlayContext to load the appropriate network OS environment plugin for handling opening and closing of shells as well as privilege escalation.
This commit is contained in:
@@ -421,8 +421,9 @@ class Connection(ConnectionBase):
|
||||
SSH_CONNECTION_CACHE.pop(cache_key, None)
|
||||
SFTP_CONNECTION_CACHE.pop(cache_key, None)
|
||||
|
||||
if self.sftp is not None:
|
||||
self.sftp.close()
|
||||
if hasattr(self, 'sftp'):
|
||||
if self.sftp is not None:
|
||||
self.sftp.close()
|
||||
|
||||
if C.HOST_KEY_CHECKING and C.PARAMIKO_RECORD_HOST_KEYS and self._any_keys_added():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user