From e10e0d42d8c8bdbf454e552f633dfbec0a0f484b Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Mon, 9 Apr 2018 16:22:09 +0530 Subject: [PATCH] Fix junos transport check (#38460) For connection=local check only if the transport value in provider is cli and the respective module support cli transport. If not report back appropriate error message. --- lib/ansible/plugins/action/junos.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/plugins/action/junos.py b/lib/ansible/plugins/action/junos.py index b0415921f96..6f617011039 100644 --- a/lib/ansible/plugins/action/junos.py +++ b/lib/ansible/plugins/action/junos.py @@ -57,8 +57,7 @@ class ActionModule(_ActionModule): pc.network_os = 'junos' pc.remote_addr = provider['host'] or self._play_context.remote_addr - if (provider['transport'] == 'cli' and self._task.action not in CLI_SUPPORTED_MODULES) or \ - (provider['transport'] == 'netconf' and self._task.action == 'junos_netconf'): + if provider['transport'] == 'cli' and self._task.action not in CLI_SUPPORTED_MODULES: return {'failed': True, 'msg': "Transport type '%s' is not valid for '%s' module. " "Please see http://docs.ansible.com/ansible/latest/network/user_guide/platform_junos.html" % (provider['transport'], self._task.action)}