diff --git a/docs/user/lib_mapper/ntctemplates_reverse.md b/docs/user/lib_mapper/ntctemplates_reverse.md index 5ede6480..ebff60fe 100644 --- a/docs/user/lib_mapper/ntctemplates_reverse.md +++ b/docs/user/lib_mapper/ntctemplates_reverse.md @@ -28,7 +28,7 @@ | ciena_saos | → | ciena_saos | | cisco_asa | → | cisco_asa | | cisco_ftd | → | cisco_ftd | -| cisco_ios | → | cisco_xe | +| cisco_ios | → | cisco_ios | | cisco_nxos | → | cisco_nxos | | cisco_s300 | → | cisco_s300 | | cisco_tp | → | cisco_tp | diff --git a/netutils/lib_mapper.py b/netutils/lib_mapper.py index 6e01e091..8e9d0900 100644 --- a/netutils/lib_mapper.py +++ b/netutils/lib_mapper.py @@ -260,7 +260,7 @@ # ntc templates is primarily based on netmiko, so a copy is in order _NTCTEMPLATES_LIB_MAPPER = copy.deepcopy(NETMIKO_LIB_MAPPER) _NTCTEMPLATES_LIB_MAPPER["aruba_aoscx"] = "aruba_aoscx" -_NTCTEMPLATES_LIB_MAPPER["cisco_xe"] = "cisco_ios" +_NTCTEMPLATES_LIB_MAPPER["cisco_xe"] = "cisco_ios" # no reverse _NTCTEMPLATES_LIB_MAPPER["huawei_vrp"] = "huawei_vrp" _NTCTEMPLATES_LIB_MAPPER["vmware_nsxv"] = "vmware_nsxv" _NTCTEMPLATES_LIB_MAPPER["watchguard_firebox"] = "watchguard_firebox" @@ -271,7 +271,9 @@ } # 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"] + value: key + for key, value in NTCTEMPLATES_LIB_MAPPER.items() + if key not in ["f5_ltm", "f5_tmsh", "f5_linux", "cisco_xe"] } diff --git a/tests/unit/test_lib_mapper.py b/tests/unit/test_lib_mapper.py index a3fac35a..8929220c 100644 --- a/tests/unit/test_lib_mapper.py +++ b/tests/unit/test_lib_mapper.py @@ -48,10 +48,15 @@ def test_lib_mapper_reverse(lib): _mapper = getattr(lib_mapper, f"{lib}_LIB_MAPPER").copy() if lib == "NAPALM": _mapper.pop("nxos_ssh") - if lib in ["NETMIKO", "NTCTEMPLATES"]: + if lib == "NETMIKO": _mapper.pop("f5_ltm") _mapper.pop("f5_tmsh") _mapper.pop("f5_linux") + if lib == "NTCTEMPLATES": + _mapper.pop("f5_ltm") + _mapper.pop("f5_tmsh") + _mapper.pop("f5_linux") + _mapper.pop("cisco_xe") if lib in [ "AERLEON", "ANSIBLE",