diff --git a/napalm_ios/ios.py b/napalm_ios/ios.py index 1d4c8ba..620814f 100644 --- a/napalm_ios/ios.py +++ b/napalm_ios/ios.py @@ -18,6 +18,7 @@ import re from netmiko import ConnectHandler, FileTransfer +from netmiko import __version__ as netmiko_version from napalm_base.base import NetworkDriver from napalm_base.exceptions import ReplaceConfigException, MergeConfigException @@ -64,6 +65,14 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) 'ssh_config_file': None, } + fields = netmiko_version.split('.') + fields = [int(x) for x in fields] + maj_ver, min_ver, bug_fix = fields + if maj_ver >= 2: + netmiko_argument_map['allow_agent'] = False + elif maj_ver == 1 and min_ver >= 1: + netmiko_argument_map['allow_agent'] = False + # Build dict of any optional Netmiko args self.netmiko_optional_args = {} for k, v in netmiko_argument_map.items(): diff --git a/requirements.txt b/requirements.txt index 7b6deef..be2156f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -napalm_base==0.17.0 +napalm_base>=0.18.0 netmiko>=1.0.0 diff --git a/setup.py b/setup.py index 202c10b..0840267 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name="napalm-ios", - version="0.3.0", + version="0.3.1", packages=find_packages(), author="David Barroso", author_email="dbarrosop@dravetech.com",