Fix netconf connection command timeout issue (#58322)

*  ncclient uses same timeout value at the time
   of connection initialisation and waiting response
*  Ansible has connect_timeout to control the waiting
   time during initial connection and `command_timeout`
   to control the wait time for resposne. Hence set the
   ncclient timeout seperately to Ansible command_timeout
   after the connection object is created sucessfully.

(cherry picked from commit db0fe4b188)
This commit is contained in:
Ganesh Nalawade 2019-06-26 21:23:07 +05:30 committed by Toshio Kuratomi
parent e2c8a64b45
commit 9a3dc5f798
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix netconf connection command timeout issue (https://github.com/ansible/ansible/pull/58322)

View file

@ -321,6 +321,8 @@ class Connection(NetworkConnectionBase):
timeout=self.get_option('persistent_connect_timeout'),
ssh_config=ssh_config
)
self._manager._timeout = self.get_option('persistent_command_timeout')
except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc))
except ImportError as exc: