Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Import NetworkDriver from napalm.base when napalm>=2.0.0 is installed
Browse files Browse the repository at this point in the history
Otherwise, couple together the local napalm_base
get_network_driver and NetworkDriver.
  • Loading branch information
mirceaulinic committed Nov 16, 2017
1 parent 819f48d commit 16d20f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions napalm_base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import sys
import pkg_resources

# Import local modules
from napalm_base.base import NetworkDriver

# Verify Python Version that is running
try:
if not(sys.version_info.major == 2 and sys.version_info.minor == 7) and \
Expand Down Expand Up @@ -53,6 +50,7 @@
if HAS_NAPALM and NAPALM_MAJOR >= 2:
# If napalm >= 2.0.0 is installed, then import get_network_driver
from napalm import get_network_driver
from napalm.base import NetworkDriver
else:
# Import std lib
import inspect
Expand All @@ -62,6 +60,7 @@
from napalm_base.exceptions import ModuleImportError
from napalm_base.mock import MockDriver
from napalm_base.utils import py23_compat
from napalm_base.base import NetworkDriver

def get_network_driver(module_name, prepend=True):
"""
Expand Down

0 comments on commit 16d20f9

Please sign in to comment.