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

Fix connect_timeout config varaible in netconf connection (#51055)

*  Fetch connect_timeout value from get_options()
   instead of play_context
This commit is contained in:
Ganesh Nalawade 2019-01-21 12:21:09 +05:30 committed by GitHub
parent 1b6228fa10
commit f547c88ade
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -314,7 +314,7 @@ class Connection(NetworkConnectionBase):
look_for_keys=self.get_option('look_for_keys'), look_for_keys=self.get_option('look_for_keys'),
device_params=device_params, device_params=device_params,
allow_agent=self._play_context.allow_agent, allow_agent=self._play_context.allow_agent,
timeout=self._play_context.timeout, timeout=self.get_option('persistent_connect_timeout'),
ssh_config=ssh_config ssh_config=ssh_config
) )
except SSHUnknownHostError as exc: except SSHUnknownHostError as exc:

View file

@ -107,7 +107,7 @@ class Netconf(NetconfBase):
hostkey_verify=obj.get_option('host_key_checking'), hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'), look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent, allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout timeout=obj.get_option('persistent_connect_timeout')
) )
except SSHUnknownHostError as exc: except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc)) raise AnsibleConnectionFailure(to_native(exc))

View file

@ -109,7 +109,7 @@ class Netconf(NetconfBase):
hostkey_verify=obj.get_option('host_key_checking'), hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'), look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent, allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout timeout=obj.get_option('persistent_connect_timeout')
) )
except SSHUnknownHostError as exc: except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc)) raise AnsibleConnectionFailure(to_native(exc))

View file

@ -117,7 +117,7 @@ class Netconf(NetconfBase):
hostkey_verify=obj.get_option('host_key_checking'), hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'), look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent, allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout timeout=obj.get_option('persistent_connect_timeout')
) )
except SSHUnknownHostError as exc: except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc)) raise AnsibleConnectionFailure(to_native(exc))

View file

@ -86,7 +86,7 @@ class Netconf(NetconfBase):
hostkey_verify=obj.get_option('host_key_checking'), hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'), look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent, allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout timeout=obj.get_option('persistent_connect_timeout')
) )
except SSHUnknownHostError as exc: except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc)) raise AnsibleConnectionFailure(to_native(exc))