From 5d1d1a72c50d4022eddb494f7cc18012e40f30f2 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Tue, 22 Aug 2017 07:25:19 -0400 Subject: [PATCH] Fix junos integration test failure (#28491) Pass ssh_config value to ncclient manager api as None if it is not set. --- lib/ansible/plugins/connection/netconf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/connection/netconf.py b/lib/ansible/plugins/connection/netconf.py index 2445552644f..d7c542a9dcf 100644 --- a/lib/ansible/plugins/connection/netconf.py +++ b/lib/ansible/plugins/connection/netconf.py @@ -25,6 +25,7 @@ import json from ansible import constants as C from ansible.errors import AnsibleConnectionFailure, AnsibleError from ansible.module_utils._text import to_bytes, to_native, to_text +from ansible.module_utils.parsing.convert_bool import BOOLEANS_TRUE from ansible.plugins.loader import netconf_loader from ansible.plugins.connection import ConnectionBase, ensure_connect from ansible.utils.jsonrpc import Rpc @@ -86,8 +87,10 @@ class Connection(Rpc, ConnectionBase): raise AnsibleConnectionFailure('Unable to automatically determine host network os. Please ansible_network_os value') ssh_config = os.getenv('ANSIBLE_NETCONF_SSH_CONFIG', False) - if ssh_config == 'True': + if ssh_config in BOOLEANS_TRUE: ssh_config = True + else: + ssh_config = None try: self._manager = manager.connect(