Skip to content

Commit

Permalink
Fix connect_timeout config varaible in netconf connection (ansible#51055
Browse files Browse the repository at this point in the history
)

*  Fetch connect_timeout value from get_options()
   instead of play_context
  • Loading branch information
ganeshrn authored Jan 21, 2019
1 parent 1b6228f commit f547c88
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/ansible/plugins/connection/netconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _connect(self):
look_for_keys=self.get_option('look_for_keys'),
device_params=device_params,
allow_agent=self._play_context.allow_agent,
timeout=self._play_context.timeout,
timeout=self.get_option('persistent_connect_timeout'),
ssh_config=ssh_config
)
except SSHUnknownHostError as exc:
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/plugins/netconf/ce.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def guess_network_os(obj):
hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout
timeout=obj.get_option('persistent_connect_timeout')
)
except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc))
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/plugins/netconf/iosxr.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def guess_network_os(obj):
hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout
timeout=obj.get_option('persistent_connect_timeout')
)
except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc))
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/plugins/netconf/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def guess_network_os(obj):
hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout
timeout=obj.get_option('persistent_connect_timeout')
)
except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc))
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/plugins/netconf/sros.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def guess_network_os(obj):
hostkey_verify=obj.get_option('host_key_checking'),
look_for_keys=obj.get_option('look_for_keys'),
allow_agent=obj._play_context.allow_agent,
timeout=obj._play_context.timeout
timeout=obj.get_option('persistent_connect_timeout')
)
except SSHUnknownHostError as exc:
raise AnsibleConnectionFailure(to_native(exc))
Expand Down

0 comments on commit f547c88

Please sign in to comment.