diff --git a/PLATFORMS.md b/PLATFORMS.md index 6f54ad0ac..4b7e7aff5 100644 --- a/PLATFORMS.md +++ b/PLATFORMS.md @@ -8,7 +8,6 @@ - Cisco IOS-XR - Cisco NX-OS - Cisco SG300 -- HP ProCurve - Juniper Junos - Linux @@ -20,6 +19,7 @@ - Alcatel AOS6/AOS8 - Apresia Systems AEOS - ARRIS CER +- Aruba OS Switch - AudioCodes Gateways & Controllers - Broadcom ICOS - Calix B6 @@ -42,6 +42,7 @@ - Fiberstore FSOS - Hillstone StoneOS - HPE Comware7 +- HPE ProCurve - Huawei - Huawei OLT - Huawei SmartAX @@ -73,7 +74,8 @@ - A10 - Accedian - Allied Telesis AlliedWare Plus -- Aruba +- Aruba OS (Wireless Controllers/WAPs) +- Aruba AOS-CX - Brocade Fabric OS - C-DOT CROS - Ciena SAOS diff --git a/netmiko/aruba/__init__.py b/netmiko/aruba/__init__.py index e9350eacb..00591af8f 100644 --- a/netmiko/aruba/__init__.py +++ b/netmiko/aruba/__init__.py @@ -1,3 +1,4 @@ -from netmiko.aruba.aruba_ssh import ArubaSSH +from netmiko.aruba.aruba_os import ArubaOsSSH +from netmiko.aruba.aruba_cx import ArubaCxSSH -__all__ = ["ArubaSSH"] +__all__ = ["ArubaOsSSH", "ArubaCxSSH"] diff --git a/netmiko/aruba/aruba_cx.py b/netmiko/aruba/aruba_cx.py new file mode 100644 index 000000000..c26978ce9 --- /dev/null +++ b/netmiko/aruba/aruba_cx.py @@ -0,0 +1,42 @@ +""" +Aruba AOS CX support. + +For use with Aruba AOS CX devices. + +""" +from typing import Any +from netmiko.cisco_base_connection import CiscoSSHConnection + + +class ArubaCxSSH(CiscoSSHConnection): + """Aruba AOS CX 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=r"[>#]") + self.set_base_prompt() + self.disable_paging(command="no page") + + def check_config_mode( + self, + check_string: str = "(config)#", + pattern: str = r"[>#]", + force_regex: bool = False, + ) -> bool: + return super().check_config_mode(check_string=check_string, pattern=pattern) + + def config_mode( + self, + config_command: str = "configure term", + pattern: str = "", + re_flags: int = 0, + ) -> str: + """Aruba auto completes on space so 'configure' needs fully spelled-out.""" + return super().config_mode( + config_command=config_command, pattern=pattern, re_flags=re_flags + ) diff --git a/netmiko/aruba/aruba_ssh.py b/netmiko/aruba/aruba_os.py similarity index 97% rename from netmiko/aruba/aruba_ssh.py rename to netmiko/aruba/aruba_os.py index 5664e37e9..1c3b5e718 100644 --- a/netmiko/aruba/aruba_ssh.py +++ b/netmiko/aruba/aruba_os.py @@ -8,7 +8,7 @@ from netmiko.cisco_base_connection import CiscoSSHConnection -class ArubaSSH(CiscoSSHConnection): +class ArubaOsSSH(CiscoSSHConnection): """Aruba OS support""" def __init__(self, **kwargs: Any) -> None: diff --git a/netmiko/ssh_dispatcher.py b/netmiko/ssh_dispatcher.py index 31ba526a8..e7a9919a8 100755 --- a/netmiko/ssh_dispatcher.py +++ b/netmiko/ssh_dispatcher.py @@ -14,7 +14,7 @@ from netmiko.arista import AristaFileTransfer from netmiko.arris import ArrisCERSSH from netmiko.apresia import ApresiaAeosSSH, ApresiaAeosTelnet -from netmiko.aruba import ArubaSSH +from netmiko.aruba import ArubaOsSSH, ArubaCxSSH from netmiko.audiocode import ( Audiocode72SSH, Audiocode66SSH, @@ -159,7 +159,8 @@ "apresia_aeos": ApresiaAeosSSH, "arista_eos": AristaSSH, "arris_cer": ArrisCERSSH, - "aruba_os": ArubaSSH, + "aruba_os": ArubaOsSSH, + "aruba_cx": ArubaCxSSH, "aruba_osswitch": HPProcurveSSH, "aruba_procurve": HPProcurveSSH, "audiocode_72": Audiocode72SSH,