Skip to content

Commit

Permalink
Use napalm supplied netmiko_args instead of my own
Browse files Browse the repository at this point in the history
Merge pull request #88 from davama/develop thanks to @davama
  • Loading branch information
qaxi authored Mar 29, 2024
2 parents 6e6b38b + 86a7689 commit 9b76a86
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions napalm_s350/s350.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ConnectionClosedException,
)
from napalm.base.helpers import canonical_interface_name
from napalm.base.netmiko_helpers import netmiko_args

import napalm.base.constants as C
import napalm.base.canonical_map
Expand Down Expand Up @@ -65,31 +66,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None)
self._dest_file_system = optional_args.get("dest_file_system", None)

# Netmiko possible arguments
netmiko_argument_map = {
"port": None,
"secret": "",
"verbose": False,
"keepalive": 30,
"global_delay_factor": 1,
"use_keys": False,
"key_file": None,
"ssh_strict": False,
"system_host_keys": False,
"alt_host_keys": False,
"alt_key_file": "",
"ssh_config_file": None,
"allow_agent": False,
"session_log": None,
"read_timeout_override": None,
}

# Allow for passing additional Netmiko arguments
self.netmiko_optional_args = {}
for k, v in netmiko_argument_map.items():
try:
self.netmiko_optional_args[k] = optional_args[k]
except KeyError:
pass
self.netmiko_optional_args = netmiko_args(optional_args)

self.platform = "s350"
self.port = optional_args.get("port", 22)
Expand Down

0 comments on commit 9b76a86

Please sign in to comment.