mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Remove repetition of code nxos (#23908)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
@@ -89,9 +89,7 @@ def get_connection(module):
|
|||||||
global _DEVICE_CONNECTION
|
global _DEVICE_CONNECTION
|
||||||
if not _DEVICE_CONNECTION:
|
if not _DEVICE_CONNECTION:
|
||||||
load_params(module)
|
load_params(module)
|
||||||
transport = module.params['transport']
|
if is_nxapi(module):
|
||||||
provider_transport = (module.params['provider'] or {}).get('transport')
|
|
||||||
if 'nxapi' in (transport, provider_transport):
|
|
||||||
conn = Nxapi(module)
|
conn = Nxapi(module)
|
||||||
else:
|
else:
|
||||||
conn = Cli(module)
|
conn = Cli(module)
|
||||||
|
|||||||
Reference in New Issue
Block a user