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

Read Timeout #31

Open
DatalinkNetworks opened this issue Jan 29, 2023 · 2 comments · May be fixed by #32
Open

Read Timeout #31

DatalinkNetworks opened this issue Jan 29, 2023 · 2 comments · May be fixed by #32

Comments

@DatalinkNetworks
Copy link

Unfortunately I do not see any way of altering the read timeout. It is set to the default value of 10 seconds. This is fine for many commands, but in particular, show log on procurve can take a long time to generate all of the output.

After delving into both napalm-procurve and napalm sources, I have determined (and tested) that this can be solved by adding a single line. Inside of procurve.py, there is a dict of possible Netmiko arguments that can be provided. Unfortunately, anything not inside this list is simply ignored. So we can either nix the whole "parameter must be defined in this possible argument map" or we can add this to the code:

        # Netmiko possible arguments
        netmiko_argument_map = {
            "port": None,
            "secret": "",
            "verbose": False,
            "keepalive": 30,
            "global_delay_factor": 1,
            "use_keys": False,
            "key_file": None,
            "ssh_strict": False,
            "system_host_keys": False,
            "alt_host_keys": False,
            "alt_key_file": "",
            "ssh_config_file": None,
        }

We simply need to add the following entry into the dict:

            "read_timeout_override": None,

Then it can be passed as an optional argument:

        driver = get_network_driver(self.driver)
        device = driver(
            hostname=self.host,
            username=self.username,
            password=self.password,
            timeout=60,
            optional_args={
                "port": self.port,
                "read_timeout_override": 30.0,
            },
        )
@davama
Copy link

davama commented Jan 30, 2023

did even realize that that option was not there.
Can you PR it?

great find!

@davama
Copy link

davama commented Feb 16, 2023

Created the PR: #32

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

Successfully merging a pull request may close this issue.

2 participants