mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
fixes issue with cli shell left open (#21548)
The nxos action plugin will now close the shell connection once the module has completely run
This commit is contained in:
@@ -68,11 +68,12 @@ def get_connection(module):
|
||||
global _DEVICE_CONNECTION
|
||||
if not _DEVICE_CONNECTION:
|
||||
load_params(module)
|
||||
transport = module.params['transport']
|
||||
if transport == 'cli':
|
||||
if 'transport' not in module.params:
|
||||
conn = Cli(module)
|
||||
elif transport == 'nxapi':
|
||||
elif module.params['transport'] == 'nxapi':
|
||||
conn = Nxapi(module)
|
||||
else:
|
||||
conn = Cli(module)
|
||||
_DEVICE_CONNECTION = conn
|
||||
return _DEVICE_CONNECTION
|
||||
|
||||
|
||||
Reference in New Issue
Block a user