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

Fix junos integration test failure (#28491)

Pass ssh_config value to ncclient manager api as None
if it is not set.
This commit is contained in:
Ganesh Nalawade 2017-08-22 07:25:19 -04:00 committed by GitHub
parent 96da0047ac
commit 5d1d1a72c5

View file

@ -25,6 +25,7 @@ import json
from ansible import constants as C from ansible import constants as C
from ansible.errors import AnsibleConnectionFailure, AnsibleError from ansible.errors import AnsibleConnectionFailure, AnsibleError
from ansible.module_utils._text import to_bytes, to_native, to_text 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.loader import netconf_loader
from ansible.plugins.connection import ConnectionBase, ensure_connect from ansible.plugins.connection import ConnectionBase, ensure_connect
from ansible.utils.jsonrpc import Rpc 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') raise AnsibleConnectionFailure('Unable to automatically determine host network os. Please ansible_network_os value')
ssh_config = os.getenv('ANSIBLE_NETCONF_SSH_CONFIG', False) ssh_config = os.getenv('ANSIBLE_NETCONF_SSH_CONFIG', False)
if ssh_config == 'True': if ssh_config in BOOLEANS_TRUE:
ssh_config = True ssh_config = True
else:
ssh_config = None
try: try:
self._manager = manager.connect( self._manager = manager.connect(