Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add junos connection type check for junos_netconf #38527

Merged
merged 1 commit into from
Apr 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ansible/plugins/action/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def run(self, tmp=None, task_vars=None):
if any(provider.values()):
display.warning('provider is unnecessary when using connection=%s and will be ignored' % self._play_context.connection)

if self._play_context.connection == 'network_cli' and self._task.action not in CLI_SUPPORTED_MODULES:
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'):
return {'failed': True, 'msg': "Connection type '%s' is not valid for '%s' module. "
"Please see http://docs.ansible.com/ansible/latest/network/user_guide/platform_junos.html"
% (self._play_context.connection, self._task.action)}
Expand Down