From e9faef5c5f1c6513f0a3fdf388e505ea4675232a Mon Sep 17 00:00:00 2001 From: checktheroads Date: Tue, 9 Feb 2021 22:31:55 -0700 Subject: [PATCH] fix arista nos mapping, closes #117 --- hyperglass/constants.py | 5 +++-- hyperglass/models/commands/__init__.py | 6 +++--- hyperglass/models/commands/{arista.py => arista_eos.py} | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) rename hyperglass/models/commands/{arista.py => arista_eos.py} (93%) diff --git a/hyperglass/constants.py b/hyperglass/constants.py index 9aefe7a..8dff98b 100644 --- a/hyperglass/constants.py +++ b/hyperglass/constants.py @@ -65,10 +65,11 @@ FUNC_COLOR_MAP = { TRANSPORT_REST = ("frr", "bird") SCRAPE_HELPERS = { - "mikrotik": "mikrotik_routeros", + "arista": "arista_eos", + "ios": "cisco_ios", "juniper_junos": "juniper", "junos": "juniper", - "ios": "cisco_ios", + "mikrotik": "mikrotik_routeros", "tsnr": "tnsr", } diff --git a/hyperglass/models/commands/__init__.py b/hyperglass/models/commands/__init__.py index 17f408e..5f3f0be 100644 --- a/hyperglass/models/commands/__init__.py +++ b/hyperglass/models/commands/__init__.py @@ -6,19 +6,19 @@ from .bird import BIRDCommands from .tnsr import TNSRCommands from .vyos import VyosCommands from ..main import HyperglassModelExtra -from .arista import AristaCommands from .common import CommandGroup from .huawei import HuaweiCommands from .juniper import JuniperCommands from .cisco_xr import CiscoXRCommands from .cisco_ios import CiscoIOSCommands +from .arista_eos import AristaEOSCommands from .cisco_nxos import CiscoNXOSCommands from .nokia_sros import NokiaSROSCommands from .mikrotik_routeros import MikrotikRouterOS from .mikrotik_switchos import MikrotikSwitchOS _NOS_MAP = { - "arista": AristaCommands, + "arista_eos": AristaEOSCommands, "bird_ssh": BIRDCommands, "cisco_ios": CiscoIOSCommands, "cisco_nxos": CiscoNXOSCommands, @@ -37,7 +37,7 @@ _NOS_MAP = { class Commands(HyperglassModelExtra): """Base class for command definitions.""" - arista: CommandGroup = AristaCommands() + arista_eos: CommandGroup = AristaEOSCommands() bird_ssh: CommandGroup = BIRDCommands() cisco_ios: CommandGroup = CiscoIOSCommands() cisco_nxos: CommandGroup = CiscoNXOSCommands() diff --git a/hyperglass/models/commands/arista.py b/hyperglass/models/commands/arista_eos.py similarity index 93% rename from hyperglass/models/commands/arista.py rename to hyperglass/models/commands/arista_eos.py index dbc858c..7d5207b 100644 --- a/hyperglass/models/commands/arista.py +++ b/hyperglass/models/commands/arista_eos.py @@ -1,4 +1,4 @@ -"""Arista Command Model.""" +"""Arista EOS Command Model.""" # Third Party from pydantic import StrictStr @@ -47,8 +47,8 @@ class _VPNIPv6(CommandSet): traceroute: StrictStr = "traceroute vrf {vrf} ipv6 {target} source {source}" -class AristaCommands(CommandGroup): - """Validation model for default arista commands.""" +class AristaEOSCommands(CommandGroup): + """Validation model for default arista_eos commands.""" ipv4_default: _IPv4 = _IPv4() ipv6_default: _IPv6 = _IPv6()