how to estimate `max_loops`?
See original GitHub issueHi!
So, according to this, the max_loops
parameter is used inside the send_command
as a while
bound before exiting. Inside the while
loop one can see that:
loop_delay=0.2
[...]
while i <= max_loops:
[...]
time.sleep(delay_factor * loop_delay)
This means that the maximum total time is max_loops * delay_factor * 0.2
.
Now, let’s say that I want to establish a maximum timeout for reading of 400s. Then max_loops=400/(0.2*delay_factor)
. With delay_factor=0.5
this leads to max_loops=4000
.
However I’ve tried limiting this but even though I’ve set max_loops=4000
(or maximum time of 400s) I still can run show commands for over 500s. Why is this happening?
Finally, I’ve seen also that max_loops
is used in send_config_set()
but there is no while-loop
inside send_config_set()
. How does it work in here? Is my estimation above still valid?
Regards!
Lucas
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Top GitHub Comments
FYI, Netmiko 4.x also has a new
send_multiline
andsend_multiline_timing
feature where you can send in a list of commands and get the output for each of those commands.You can see some examples in the test code here:
https://github.com/ktbyers/netmiko/blob/develop/tests/test_netmiko_show.py#L267
Fair enough…just don’t ask questions of the form
I am using send_config_set() for show commands and it is not working properly
. 😃This equation does not apply for send_config_set() i.e. that only applies to send_command.
I am probably going to completely remove max_loops from send_config_set() in Netmiko 4.X. It was used for a different purpose and was probably very rarely used and was being deprecated anyways.