Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

junos_install_config: apply timeout to initial device connection #146

Open
AndyMan1 opened this issue Jul 9, 2016 · 2 comments
Open

junos_install_config: apply timeout to initial device connection #146

AndyMan1 opened this issue Jul 9, 2016 · 2 comments

Comments

@AndyMan1
Copy link

AndyMan1 commented Jul 9, 2016

junos_install_config has a timeout parameter but it's not used when opening the initial connection to the device, here.

If the device is down or the host/port is incorrect, it can take upwards of 4 minutes to eventually timeout, depending on other defaults.

It would be great if timeout was applied to device.open() as well, so you could limit long timeouts.

This will require some coordination with Juniper/py-junos-eznc.It uses ncclient's manager which does have a timeout parameter, but device.open() doesn't seem to make use of it

@jnpr-bowen
Copy link

I would say this issue does not need a fix in junos_install_config. If there is a concern that a device might not be reachable then use the wait_for task before calling the junos_install_config task The wait_for task checks that a TCP session can be established to the device on a given port and has a timeout option to control how long to give a device to respond.

@stacywsmith
Copy link
Contributor

@AndyMan1 I think your request is valid. As you point out, this capability needs to first be added to PyEZ. Can you please open a corresponding issue against PyEZ?

I feel the workaround @jnpr-bowen suggests by first checking reachability to the device using the wait_for module is reasonable and best practice for Ansible. However, that doesn't address the native PyEZ need for a connection timeout parameter, and if we implement it in PyEZ we might as well expose it in the Ansible modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants