Skip to content

Commit

Permalink
Merge pull request #3430 from ktbyers/aruba_cx_driver
Browse files Browse the repository at this point in the history
Aruba CX Driver
  • Loading branch information
ktbyers authored May 3, 2024
2 parents 04e986f + 07c92b5 commit fae3d31
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 7 deletions.
6 changes: 4 additions & 2 deletions PLATFORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
- Cisco IOS-XR
- Cisco NX-OS
- Cisco SG300
- HP ProCurve
- Juniper Junos
- Linux

Expand All @@ -20,6 +19,7 @@
- Alcatel AOS6/AOS8
- Apresia Systems AEOS
- ARRIS CER
- Aruba OS Switch
- AudioCodes Gateways & Controllers
- Broadcom ICOS
- Calix B6
Expand All @@ -42,6 +42,7 @@
- Fiberstore FSOS
- Hillstone StoneOS
- HPE Comware7
- HPE ProCurve
- Huawei
- Huawei OLT
- Huawei SmartAX
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions netmiko/aruba/__init__.py
Original file line number Diff line number Diff line change
@@ -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"]
42 changes: 42 additions & 0 deletions netmiko/aruba/aruba_cx.py
Original file line number Diff line number Diff line change
@@ -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
)
2 changes: 1 addition & 1 deletion netmiko/aruba/aruba_ssh.py → netmiko/aruba/aruba_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions netmiko/ssh_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fae3d31

Please sign in to comment.