Skip to content

Commit

Permalink
Merge pull request #12 from napalm-automation-community/netmiko-4.x
Browse files Browse the repository at this point in the history
Working around #11 until the next Netmiko release
  • Loading branch information
mirceaulinic authored Jul 26, 2022
2 parents a217ddc + 6417574 commit 26eda76
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion napalm_opengear/opengear.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ def open(self):
global_delay_factor=2,
**self.netmiko_optional_args
)
self.device.enable()
if not self.device.base_prompt:
# If Netmiko fails to detect the prompt due to OpenGear not setting
# anything before the pound sign, we set the base_prompt attribute
# so Netmiko is able to read (either # when the username is root, or
# $ for anything else)
self.base_prompt = "#" if self.username == "root" else "$"
if self.username != "root":
self.device.enable()

def close(self):
self._netmiko_close()
Expand Down

0 comments on commit 26eda76

Please sign in to comment.