mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 06:31:23 -07: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:
parent
20c5a1adc1
commit
c9f6a2b740
2 changed files with 30 additions and 12 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue