1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fixes issue with setting transport to nxapi (#21811)

The nxos action handler did not map the nxapi value to the provider
argument properly.  There as an additional fix in the nxos shared lib
to properly detect nxapi being set
This commit is contained in:
Peter Sprygada 2017-02-22 22:07:33 -05:00 committed by GitHub
parent 4554e8d769
commit 0e7ebf6391
2 changed files with 4 additions and 3 deletions

View file

@ -72,9 +72,9 @@ def get_connection(module):
global _DEVICE_CONNECTION global _DEVICE_CONNECTION
if not _DEVICE_CONNECTION: if not _DEVICE_CONNECTION:
load_params(module) load_params(module)
if 'transport' not in module.params: transport = module.params['transport']
conn = Cli(module) provider_transport = (module.params['provider'] or {}).get('transport')
elif module.params['transport'] == 'nxapi': if 'nxapi' in (transport, provider_transport):
conn = Nxapi(module) conn = Nxapi(module)
else: else:
conn = Cli(module) conn = Cli(module)

View file

@ -87,6 +87,7 @@ class ActionModule(_ActionModule):
else: else:
provider_arg = { provider_arg = {
'transport': 'nxapi',
'host': self._play_context.remote_addr, 'host': self._play_context.remote_addr,
'port': provider.get('port'), 'port': provider.get('port'),
'username': provider.get('username') or self._play_context.connection_user, 'username': provider.get('username') or self._play_context.connection_user,