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:
parent
96da0047ac
commit
5d1d1a72c5
1 changed files with 4 additions and 1 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue