Closing NAPALM connections automatically
See original GitHub issueWhen using NAPALM plugins connections stay open and can cause scripts to hang while waiting for the connections to timeout.
Forcing the connections to close using a task helps with this.
task.host.connections["napalm"].close()
Maybe this could be done automatically? It’ll require to find a way to know which connections are not useful anymore.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
NetworkDriver — NAPALM 3 documentation
Closes the connection to the device. Commits the changes requested by the method load_replace_candidate or load_merge_candidate. NAPALM drivers that support ' ...
Read more >NAPALM Documentation - Read the Docs
It handles opening and closing the session automatically and it's the pythonic way: >>> from napalm import get_network_driver.
Read more >How to Automate Networks with NAPALM and Python!
DescriptionWhat do you do if you have network devices from more than one vendor? Will you have to write Python scripts for each...
Read more >Automation 9. Comparing data collection with NAPALM and ...
NAPALM interacts with network devices based on some device specific interface (e.g., eAPI for Arista EOS and XML for Cisco IOS XR) and...
Read more >Network Automation Using Unified API - Napalm - Cisco Blogs
NAPALM supports several methods to connect to the devices, to manipulate configurations or to retrieve data. I had been learning Python for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I thought we could look into creating a “close” task so it’s easier for the user to explicitly close the connections or maybe do it automatically via the garbage collector by implementing some code in the del magic method.
The solution for this is in Nornir 2.0 is to use the Context Manager coupled with InitNornir. Should be details on this in PR #195