Closed XioNoX closed 7 years ago
@XioNoX Your PR will fail if running netmiko 1.0. I think you should probably do a check for Netmiko version, if netmiko 1.0 then no allow_agent key, if netmiko >= 1.1 then allow_agent key in the dictionary.
@XioNoX Hmmmm don't like it (as you are counting on there never being a Netmiko version that used '10' for min_ver or bug_fix)...
if int(maj_ver + min_ver + bug_fix) >= 110:
netmiko_argument_map['allow_agent'] = False
How about this? I know it is a few more lines of code, but it will go away before whenever the Netmiko-napalm version requirement is increased.
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
Reviewed by me.
Two things:
Thanks!
Thx for the clarification and the PR : )
Now that netmiko supports paramiko's "allow_agent" (see https://github.com/ktbyers/netmiko/releases/tag/v1.1.0 )
This patch is to add that option to the accepted optional args for napalm-ios