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

Fix Nornir + NAPALM threading issue #1081

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions napalm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
from napalm.base import get_network_driver
from napalm._SUPPORTED_DRIVERS import SUPPORTED_DRIVERS

# Load constituent packages to fix threading deadlock on get_network_driver()
import napalm.eos
import napalm.ios
import napalm.iosxr
import napalm.junos
import napalm.nxos
import napalm.nxos_ssh
import napalm.pyIOSXR
import napalm.nxapi_plumbing # noqa

# Verify Python Version that is running
try:
if not (sys.version_info.major == 2 and sys.version_info.minor == 7) and not (
sys.version_info.major == 3
):
raise RuntimeError("NAPALM requires Python 2.7 or Python3")
if not (sys.version_info.major == 3 and sys.version_info.minor >= 6):
raise RuntimeError("NAPALM requires Python 3.6 or greater")
except AttributeError:
raise RuntimeError("NAPALM requires Python 2.7 or Python3")
raise RuntimeError("NAPALM requires Python 3.6 or greater")

try:
__version__ = pkg_resources.get_distribution("napalm").version
Expand Down