Remove provider (and transport, where applicable) from consideration when not using connection=local (#39555)

* Remove provider (and transport, where applicable) from consideration

* Add tests that misplaced transport does not fail task
This commit is contained in:
Nathaniel Case 2018-05-08 12:06:37 -04:00 committed by GitHub
parent 384a0d8b01
commit c6270e15a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 48 additions and 2 deletions

View file

@ -88,7 +88,8 @@ class ActionModule(_ActionModule):
elif self._play_context.connection in ('netconf', 'network_cli'):
provider = self._task.args.get('provider', {})
if any(provider.values()):
display.warning('provider is unnecessary when using connection=%s and will be ignored' % self._play_context.connection)
display.warning('provider is unnecessary when using %s and will be ignored' % self._play_context.connection)
del self._task.args['provider']
if (self._play_context.connection == 'network_cli' and self._task.action not in CLI_SUPPORTED_MODULES) or \
(self._play_context.connection == 'netconf' and self._task.action == 'junos_netconf'):