Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for corvil #3541

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions netmiko/corvil/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from netmiko.corvil.corvilcne_ssh import CorvilCNESSH

__all__ = [
"CorvilCNESSH"
]
45 changes: 45 additions & 0 deletions netmiko/corvil/corvilcne_ssh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
Corvil CNE support.

For use with Corvil CNE devices.

"""
from typing import Any
from netmiko.cisco_base_connection import CiscoSSHConnection


class CorvilCNESSH(CiscoSSHConnection):
"""Corvil CNE support"""

def __init__(self, **kwargs: Any) -> None:
if kwargs.get("default_enter") is None:
kwargs["default_enter"] = "\r"
return super().__init__(**kwargs)

def session_preparation(self) -> None:
self.ansi_escape_codes = True
self._test_channel_read(pattern="$")
self.disable_paging(command="terminal length 0")

def check_config_mode(
self,
check_string: str = "(config) $",
pattern: str = r"[$]",
force_regex: bool = False,
) -> bool:
"""
Checks if the device is in configuration mode or not.

Corvil uses "<devicename>(config) $" as config prompt
"""
return super().check_config_mode(check_string=check_string, pattern=pattern)

def config_mode(
self,
config_command: str = "config",
pattern: str = "",
re_flags: int = 0,
) -> str:
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)
5 changes: 5 additions & 0 deletions netmiko/gigamon/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from netmiko.gigamon.gigamonvue_ssh import GigamonVUESSH

__all__ = [
"GigamonVUESSH"
]
45 changes: 45 additions & 0 deletions netmiko/gigamon/gigamonvue_ssh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
Gigamon GigaVUE support.

For use with Gigamon GigaVUE devices.

"""
from typing import Any
from netmiko.cisco_base_connection import CiscoSSHConnection


class GigamonVUESSH(CiscoSSHConnection):
"""Gigamon GigaVUE support"""

def __init__(self, **kwargs: Any) -> None:
if kwargs.get("default_enter") is None:
kwargs["default_enter"] = "\r"
return super().__init__(**kwargs)

def session_preparation(self) -> None:
self.ansi_escape_codes = True
self.set_base_prompt()
self.disable_paging(command="no cli session paging enable")

def check_config_mode(
self,
check_string: str = "(config) #",
pattern: str = r"[>#]",
force_regex: bool = False,
) -> bool:
"""
Checks if the device is in configuration mode or not.

Perle uses "(<devicename>) (config) #" as config prompt
"""
return super().check_config_mode(check_string=check_string, pattern=pattern)

def config_mode(
self,
config_command: str = "configure terminal",
pattern: str = "",
re_flags: int = 0,
) -> str:
return super().config_mode(
config_command=config_command, pattern=pattern, re_flags=re_flags
)
4 changes: 4 additions & 0 deletions netmiko/ssh_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from netmiko.citrix import NetscalerSSH
from netmiko.cloudgenix import CloudGenixIonSSH
from netmiko.coriant import CoriantSSH
from netmiko.corvil import CorvilCNESSH
from netmiko.dell import DellDNOS6SSH
from netmiko.dell import DellDNOS6Telnet
from netmiko.dell import DellForce10SSH
Expand Down Expand Up @@ -85,6 +86,7 @@
from netmiko.fiberstore import FiberstoreFsosSSH
from netmiko.flexvnf import FlexvnfSSH
from netmiko.fortinet import FortinetSSH
from netmiko.gigamon import GigamonVUESSH
from netmiko.garderos import GarderosGrsSSH
from netmiko.hillstone import HillstoneStoneosSSH
from netmiko.hp import HPProcurveSSH, HPProcurveTelnet, HPComwareSSH, HPComwareTelnet
Expand Down Expand Up @@ -202,6 +204,7 @@
"cisco_xr": CiscoXrSSH,
"cloudgenix_ion": CloudGenixIonSSH,
"coriant": CoriantSSH,
"corvil_cne": CorvilCNESSH,
"dell_dnos9": DellForce10SSH,
"dell_force10": DellForce10SSH,
"dell_os6": DellDNOS6SSH,
Expand Down Expand Up @@ -238,6 +241,7 @@
"garderos_grs": GarderosGrsSSH,
"generic": GenericSSH,
"generic_termserver": TerminalServerSSH,
"gigamon_gigavue": GigamonVUESSH,
"hillstone_stoneos": HillstoneStoneosSSH,
"hp_comware": HPComwareSSH,
"hp_procurve": HPProcurveSSH,
Expand Down
Loading