From bda0478f9adbc7802b1a2519b7684d157876253b Mon Sep 17 00:00:00 2001 From: Carlos Huaccho Date: Wed, 10 Jun 2026 10:30:16 -0400 Subject: [PATCH 1/2] updating mib mapper and docs --- docs/user/lib_mapper/netmiko.md | 2 +- docs/user/lib_mapper/netmiko_reverse.md | 1 - docs/user/lib_mapper/ntctemplates.md | 2 +- docs/user/lib_mapper/ntctemplates_reverse.md | 1 - netutils/lib_mapper.py | 73 ++++++++++---------- 5 files changed, 40 insertions(+), 39 deletions(-) diff --git a/docs/user/lib_mapper/netmiko.md b/docs/user/lib_mapper/netmiko.md index 117e1bfa..fa52a674 100644 --- a/docs/user/lib_mapper/netmiko.md +++ b/docs/user/lib_mapper/netmiko.md @@ -6,7 +6,7 @@ | adva_fsp150f2 | → | adva_fsp150f2 | | adva_fsp150f3 | → | adva_fsp150f3 | | alcatel_aos | → | alcatel_aos | -| alcatel_sros | → | alcatel_sros | +| alcatel_sros | → | nokia_sros | | allied_telesis_awplus | → | allied_telesis_awplus | | apresia_aeos | → | apresia_aeos | | arista_eos | → | arista_eos | diff --git a/docs/user/lib_mapper/netmiko_reverse.md b/docs/user/lib_mapper/netmiko_reverse.md index 721355a3..36a4f3ea 100644 --- a/docs/user/lib_mapper/netmiko_reverse.md +++ b/docs/user/lib_mapper/netmiko_reverse.md @@ -6,7 +6,6 @@ | adva_fsp150f2 | → | adva_fsp150f2 | | adva_fsp150f3 | → | adva_fsp150f3 | | alcatel_aos | → | alcatel_aos | -| alcatel_sros | → | alcatel_sros | | allied_telesis_awplus | → | allied_telesis_awplus | | apresia_aeos | → | apresia_aeos | | arista_eos | → | arista_eos | diff --git a/docs/user/lib_mapper/ntctemplates.md b/docs/user/lib_mapper/ntctemplates.md index c2bb45de..0526a19c 100644 --- a/docs/user/lib_mapper/ntctemplates.md +++ b/docs/user/lib_mapper/ntctemplates.md @@ -6,7 +6,7 @@ | adva_fsp150f2 | → | adva_fsp150f2 | | adva_fsp150f3 | → | adva_fsp150f3 | | alcatel_aos | → | alcatel_aos | -| alcatel_sros | → | alcatel_sros | +| alcatel_sros | → | nokia_sros | | allied_telesis_awplus | → | allied_telesis_awplus | | apresia_aeos | → | apresia_aeos | | arista_eos | → | arista_eos | diff --git a/docs/user/lib_mapper/ntctemplates_reverse.md b/docs/user/lib_mapper/ntctemplates_reverse.md index aa2bf40c..91eb9dd0 100644 --- a/docs/user/lib_mapper/ntctemplates_reverse.md +++ b/docs/user/lib_mapper/ntctemplates_reverse.md @@ -6,7 +6,6 @@ | adva_fsp150f2 | → | adva_fsp150f2 | | adva_fsp150f3 | → | adva_fsp150f3 | | alcatel_aos | → | alcatel_aos | -| alcatel_sros | → | alcatel_sros | | allied_telesis_awplus | → | allied_telesis_awplus | | apresia_aeos | → | apresia_aeos | | arista_eos | → | arista_eos | diff --git a/netutils/lib_mapper.py b/netutils/lib_mapper.py index 2f473f2d..86514d3c 100644 --- a/netutils/lib_mapper.py +++ b/netutils/lib_mapper.py @@ -1,10 +1,9 @@ """Variable definitions to map from network automation library to network automation library.""" import copy -import typing as t # AERLEON | Normalized -AERLEON_LIB_MAPPER: t.Dict[str, str] = { +AERLEON_LIB_MAPPER: dict[str, str] = { "arista": "arista_eos", "aruba": "aruba_aoscx", "brocade": "brocade_nos", @@ -36,7 +35,7 @@ } # Normalized | AERLEON -AERLEON_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +AERLEON_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "arista", "aruba_aoscx": "aruba", "brocade_nos": "brocade", @@ -65,7 +64,7 @@ # CAPIRCA | Normalized -CAPIRCA_LIB_MAPPER: t.Dict[str, str] = { +CAPIRCA_LIB_MAPPER: dict[str, str] = { "arista": "arista_eos", "aruba": "aruba_aoscx", "brocade": "brocade_nos", @@ -97,7 +96,7 @@ } # Normalized | CAPIRCA -CAPIRCA_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +CAPIRCA_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "arista", "aruba_aoscx": "aruba", "brocade_nos": "brocade", @@ -146,14 +145,14 @@ DNA_CENTER_LIB_MAPPER_REVERSE = copy.deepcopy(DNACENTER_LIB_MAPPER_REVERSE) # Normalized | Netmiko -NETMIKO_LIB_MAPPER: t.Dict[str, str] = { +NETMIKO_LIB_MAPPER: dict[str, str] = { "a10": "a10", "accedian": "accedian", "adtran_os": "adtran_os", "adva_fsp150f2": "adva_fsp150f2", "adva_fsp150f3": "adva_fsp150f3", "alcatel_aos": "alcatel_aos", - "alcatel_sros": "alcatel_sros", + "alcatel_sros": "nokia_sros", "allied_telesis_awplus": "allied_telesis_awplus", "apresia_aeos": "apresia_aeos", "arista_eos": "arista_eos", @@ -263,8 +262,10 @@ } # netmiko is the base name, so every key is a value, this ensure that. # Netmiko | Normalized -NETMIKO_LIB_MAPPER_REVERSE: t.Dict[str, str] = { - value: key for key, value in NETMIKO_LIB_MAPPER.items() if key not in ["f5_ltm", "f5_tmsh", "f5_linux"] +NETMIKO_LIB_MAPPER_REVERSE: dict[str, str] = { + value: key + for key, value in NETMIKO_LIB_MAPPER.items() + if key not in ["f5_ltm", "f5_tmsh", "f5_linux", "alcatel_sros"] } # ntc templates is primarily based on netmiko, so a copy is in order @@ -276,12 +277,14 @@ _NTCTEMPLATES_LIB_MAPPER["watchguard_firebox"] = "watchguard_firebox" # NTCTemplates | Normalized -NTCTEMPLATES_LIB_MAPPER: t.Dict[str, str] = { +NTCTEMPLATES_LIB_MAPPER: dict[str, str] = { key: _NTCTEMPLATES_LIB_MAPPER[key] for key in sorted(_NTCTEMPLATES_LIB_MAPPER) } # Normalized | NTCTemplates -_NTCTEMPLATES_LIB_MAPPER_REVERSE: t.Dict[str, str] = { - value: key for key, value in NTCTEMPLATES_LIB_MAPPER.items() if key not in ["f5_ltm", "f5_tmsh", "f5_linux"] +_NTCTEMPLATES_LIB_MAPPER_REVERSE: dict[str, str] = { + value: key + for key, value in NTCTEMPLATES_LIB_MAPPER.items() + if key not in ["f5_ltm", "f5_tmsh", "f5_linux", "alcatel_sros"] } _NTCTEMPLATES_LIB_MAPPER_REVERSE["cisco_xe"] = "cisco_ios" # only reverse @@ -289,7 +292,7 @@ NTCTEMPLATES_LIB_MAPPER_REVERSE = copy.deepcopy(_NTCTEMPLATES_LIB_MAPPER_REVERSE) # NAPALM | Normalized -NAPALM_LIB_MAPPER: t.Dict[str, str] = { +NAPALM_LIB_MAPPER: dict[str, str] = { "aoscx": "aruba_aoscx", "asa": "cisco_asa", "cisco_wlc_ssh": "cisco_wlc", @@ -310,7 +313,7 @@ } # Running config command -RUNNING_CONFIG_MAPPER: t.Dict[str, str] = { +RUNNING_CONFIG_MAPPER: dict[str, str] = { "adva_fsp150f2": "show running-config", "adva_fsp150f3": "show running-config delta", "arista_eos": "show running-config", @@ -345,7 +348,7 @@ } # PYTNC | Normalized -PYNTC_LIB_MAPPER: t.Dict[str, str] = { +PYNTC_LIB_MAPPER: dict[str, str] = { "arista_eos_eapi": "arista_eos", "cisco_aireos_ssh": "cisco_wlc", "cisco_asa_ssh": "cisco_asa", @@ -356,7 +359,7 @@ } # Ansible | Normalized -ANSIBLE_LIB_MAPPER: t.Dict[str, str] = { +ANSIBLE_LIB_MAPPER: dict[str, str] = { "a10.acos_axapi.a10": "a10", "arista.eos.eos": "arista_eos", "arubanetworks.aoscx": "aruba_aoscx", @@ -392,7 +395,7 @@ } # PYATS | Normalized -PYATS_LIB_MAPPER: t.Dict[str, str] = { +PYATS_LIB_MAPPER: dict[str, str] = { "asa": "cisco_asa", "bigip": "bigip_f5", "dnac": "cisco_dnac", @@ -407,7 +410,7 @@ } # SCRAPLI | Normalized -SCRAPLI_LIB_MAPPER: t.Dict[str, str] = { +SCRAPLI_LIB_MAPPER: dict[str, str] = { "arista_eos": "arista_eos", "aruba_aoscx": "aruba_aoscx", "cisco_iosxe": "cisco_ios", @@ -418,7 +421,7 @@ } # HIERCONFIG | Normalized -HIERCONFIG_LIB_MAPPER: t.Dict[str, str] = { +HIERCONFIG_LIB_MAPPER: dict[str, str] = { "eos": "arista_eos", "fastiron": "ruckus_fastiron", "ios": "cisco_ios", @@ -430,7 +433,7 @@ } # Netutils Parser | Normalized -NETUTILSPARSER_LIB_MAPPER: t.Dict[str, str] = { +NETUTILSPARSER_LIB_MAPPER: dict[str, str] = { "adva_fsp150f2": "adva_fsp150f2", "adva_fsp150f3": "adva_fsp150f3", "arista_eos": "arista_eos", @@ -463,7 +466,7 @@ } # Forward Networks Parser | Normalized -FORWARDNETWORKS_LIB_MAPPER: t.Dict[str, str] = { +FORWARDNETWORKS_LIB_MAPPER: dict[str, str] = { "ARISTA_EOS": "arista_eos", "ARUBA_SWITCH": "aruba_aoscx", "ASA": "cisco_asa", @@ -483,7 +486,7 @@ } # NIST | Normalized -NIST_LIB_MAPPER: t.Dict[str, str] = { +NIST_LIB_MAPPER: dict[str, str] = { "arista:eos": "arista_eos", "arubanetworks:arubaos": "aruba_os", "cisco:adaptive_security_appliance_software": "cisco_asa", @@ -496,7 +499,7 @@ } # Normalized | NAPALM -NAPALM_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +NAPALM_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "eos", "aruba_aoscx": "aoscx", "bigip_f5": "f5", @@ -517,7 +520,7 @@ } # Normalized | PYTNC -PYNTC_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +PYNTC_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "arista_eos_eapi", "bigip_f5": "f5_tmos_icontrol", "cisco_asa": "cisco_asa_ssh", @@ -529,7 +532,7 @@ } # Normalized | ANSIBLE -ANSIBLE_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +ANSIBLE_LIB_MAPPER_REVERSE: dict[str, str] = { "a10": "a10.acos_axapi.a10", "arista_eos": "arista.eos.eos", "aruba_aoscx": "arubanetworks.aoscx", @@ -566,7 +569,7 @@ } # Normalized | PYATS -PYATS_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +PYATS_LIB_MAPPER_REVERSE: dict[str, str] = { "bigip_f5": "bigip", "cisco_asa": "asa", "cisco_dnac": "dnac", @@ -581,7 +584,7 @@ } # Normalized | Scrapli -SCRAPLI_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +SCRAPLI_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "arista_eos", "aruba_aoscx": "aruba_aoscx", "cisco_ios": "cisco_iosxe", @@ -593,7 +596,7 @@ } # Normalized | HIERCONFIG -HIERCONFIG_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +HIERCONFIG_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "eos", "cisco_ios": "ios", "cisco_nxos": "nxos", @@ -605,7 +608,7 @@ } # Normalized | Netutils Parser -NETUTILSPARSER_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +NETUTILSPARSER_LIB_MAPPER_REVERSE: dict[str, str] = { "adva_fsp150f2": "adva_fsp150f2", "adva_fsp150f3": "adva_fsp150f3", "arista_eos": "arista_eos", @@ -639,7 +642,7 @@ } # Normalized | Forward Networks Parser -FORWARDNETWORKS_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +FORWARDNETWORKS_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "ARISTA_EOS", "aruba_aoscx": "ARUBA_SWITCH", "bigip_f5": "F5", @@ -657,7 +660,7 @@ } # Normalized | NIST -NIST_LIB_MAPPER_REVERSE: t.Dict[str, str] = { +NIST_LIB_MAPPER_REVERSE: dict[str, str] = { "arista_eos": "arista:eos", "aruba_os": "arubanetworks:arubaos", "cisco_asa": "cisco:adaptive_security_appliance_software", @@ -700,9 +703,9 @@ _MAIN_LIB_MAPPER["vmware_nsxt"] = "vmware_nsxt" _MAIN_LIB_MAPPER["watchguard_firebox"] = "watchguard_firebox" _MAIN_LIB_MAPPER["windows"] = "windows" -MAIN_LIB_MAPPER: t.Dict[str, str] = {key: _MAIN_LIB_MAPPER[key] for key in sorted(_MAIN_LIB_MAPPER)} +MAIN_LIB_MAPPER: dict[str, str] = {key: _MAIN_LIB_MAPPER[key] for key in sorted(_MAIN_LIB_MAPPER)} -NAME_TO_LIB_MAPPER: t.Dict[str, t.Dict[str, str]] = { +NAME_TO_LIB_MAPPER: dict[str, dict[str, str]] = { "aerleon": AERLEON_LIB_MAPPER, "ansible": ANSIBLE_LIB_MAPPER, "capirca": CAPIRCA_LIB_MAPPER, @@ -720,7 +723,7 @@ } -NAME_TO_LIB_MAPPER_REVERSE: t.Dict[str, t.Dict[str, str]] = { +NAME_TO_LIB_MAPPER_REVERSE: dict[str, dict[str, str]] = { "aerleon": AERLEON_LIB_MAPPER_REVERSE, "ansible": ANSIBLE_LIB_MAPPER_REVERSE, "capirca": CAPIRCA_LIB_MAPPER_REVERSE, @@ -748,7 +751,7 @@ # "ansible": "cisco.nxos.nxos", # "napalm": "nxos", # }, -NAME_TO_ALL_LIB_MAPPER: t.Dict[str, t.Dict[str, str]] = {} +NAME_TO_ALL_LIB_MAPPER: dict[str, dict[str, str]] = {} for tool_name, mappings in NAME_TO_LIB_MAPPER_REVERSE.items(): for normalized_name, mapped_name in mappings.items(): From de55b8a52601d5955cecbcfce4545806c8396540 Mon Sep 17 00:00:00 2001 From: Carlos Huaccho Date: Wed, 10 Jun 2026 10:48:20 -0400 Subject: [PATCH 2/2] Add changelog fragment for nokia_sros mapper change --- changes/+nokia-sros-mapper.changed | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/+nokia-sros-mapper.changed diff --git a/changes/+nokia-sros-mapper.changed b/changes/+nokia-sros-mapper.changed new file mode 100644 index 00000000..172687bb --- /dev/null +++ b/changes/+nokia-sros-mapper.changed @@ -0,0 +1 @@ +Updated Netmiko and ntc-templates lib mappers to map `alcatel_sros` to the normalized `nokia_sros` platform.