Skip to content

Commit

Permalink
Merge pull request #10 from napalm-automation-community/sudo-secret
Browse files Browse the repository at this point in the history
  • Loading branch information
yeled authored May 13, 2021
2 parents 4370f59 + 0e3500c commit a217ddc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions napalm_opengear/opengear.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import socket
from collections import defaultdict

from netmiko import ConnectHandler
from napalm.base.helpers import textfsm_extractor
from napalm.base.helpers import mac, ip
from napalm.base.netmiko_helpers import netmiko_args
Expand All @@ -23,6 +24,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None)
self.hostname = hostname
self.username = username
self.password = password
self.secret = password
self.timeout = timeout
self.changed = False
self.loaded = False
Expand All @@ -36,7 +38,7 @@ def _send_command(self, command):
"""Wrapper for Netmiko's send_command_timer method.
We use this because OpenGear prompt is weird.
"""
return self.device.send_command_timing(command)
return self.device.send_command_timing(command, delay_factor=4)


def cli(self, cmd):
Expand All @@ -48,10 +50,15 @@ def cli(self, cmd):

def open(self):
"""Open a connection to the device."""
self.device = self._netmiko_open(
'linux',
netmiko_optional_args=self.netmiko_optional_args,
self.device = ConnectHandler(device_type='linux',
host=self.hostname,
username=self.username,
password=self.password,
secret=self.secret,
global_delay_factor=2,
**self.netmiko_optional_args
)
self.device.enable()

def close(self):
self._netmiko_close()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def parse_reqs(file_path):

setup(
name="napalm-opengear",
version="0.3.4",
version="0.3.5",
packages=find_packages(),
author="Charlie Allom",
author_email="[email protected]",
Expand Down

0 comments on commit a217ddc

Please sign in to comment.