From 3f84268e1f73789bcbc418f8fea949a44bcdfc39 Mon Sep 17 00:00:00 2001 From: Adam Byczkowski <38091261+qduk@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:00:28 -0600 Subject: [PATCH 1/2] Updated parsers --- netutils/lib_mapper.py | 12 ++++++++---- tests/unit/test_lib_mapper.py | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/netutils/lib_mapper.py b/netutils/lib_mapper.py index 90acbda8..f2c351a2 100644 --- a/netutils/lib_mapper.py +++ b/netutils/lib_mapper.py @@ -132,7 +132,7 @@ "eos": "arista_eos", "f5": "bigip_f5", "fortios": "fortinet", - "huawei": "huawei_vrp", + "huawei_vrp": "huawei", "ios": "cisco_ios", "iosxr": "cisco_xr", "junos": "juniper_junos", @@ -227,7 +227,7 @@ "cisco_aireos": "cisco_aireos", "cisco_asa": "cisco_asa", "cisco_ios": "cisco_ios", - "cisco_iosxr": "cisco_iosxr", + "cisco_iosxr": "cisco_xr", "cisco_nxos": "cisco_nxos", "citrix_netscaler": "citrix_netscaler", "extreme_netiron": "extreme_netiron", @@ -254,8 +254,9 @@ "cisco_nxos": "nxos", "cisco_wlc": "cisco_wlc_ssh", "cisco_xr": "iosxr", + "cisco_xe": "cisco_ios", "fortinet": "fortios", - "huawei_vrp": "huawei", + "huawei": "huawei_vrp", "juniper_junos": "junos", "mikrotik_routeros": "ros", "nokia_sros": "sros", @@ -267,6 +268,7 @@ "arista_eos": "arista_eos_eapi", "cisco_asa": "cisco_asa_ssh", "cisco_ios": "cisco_ios_ssh", + "cisco_xe": "cisco_ios_ssh", "cisco_nxos": "cisco_nxos_nxapi", "cisco_wlc": "cisco_aireos_ssh", "f5_tmsh": "f5_tmos_icontrol", @@ -279,6 +281,7 @@ "aruba_aoscx": "arubanetworks.aoscx", "ciena_saos": "ciena.saos6.saos6", "cisco_asa": "cisco.asa.asa", + "cisco_xe": "cisco.ios.ios", "cisco_ios": "cisco.ios.ios", "cisco_nxos": "cisco.nxos.nxos", "cisco_xr": "cisco.iosxr.iosxr", @@ -308,6 +311,7 @@ "cisco_dnac": "dnac", "cisco_ios": "iosxe", "cisco_nxos": "nxos", + "cisco_xe": "iosxe", "cisco_viptella": "viptela", "cisco_xr": "iosxr", "f5_tmsh": "bigip", @@ -344,8 +348,8 @@ "cisco_aireos": "cisco_aireos", "cisco_asa": "cisco_asa", "cisco_ios": "cisco_ios", - "cisco_iosxr": "cisco_iosxr", "cisco_nxos": "cisco_nxos", + "cisco_xr": "cisco_iosxr", "citrix_netscaler": "citrix_netscaler", "extreme_netiron": "extreme_netiron", "fortinet_fortios": "fortinet_fortios", diff --git a/tests/unit/test_lib_mapper.py b/tests/unit/test_lib_mapper.py index 40a9a923..2ab7602a 100644 --- a/tests/unit/test_lib_mapper.py +++ b/tests/unit/test_lib_mapper.py @@ -32,6 +32,8 @@ def test_lib_mapper_reverse(lib): _mapper.pop("nxos_ssh") mapper = dict((v, k) for k, v in _mapper.items()) rev_mapper = getattr(lib_mapper, f"{lib}_LIB_MAPPER_REVERSE") + if lib in ["ANSIBLE", "NAPALM", "PYATS", "PYNTC"]: + rev_mapper.pop("cisco_xe") assert mapper == rev_mapper @@ -46,6 +48,6 @@ def test_lib_mapper_alpha(lib): def test_netutils_parser(): - """Test that the paser_map in compliance have been added to NETUTILSPARSER lib mappers.""" + """Test that the parser_map in compliance have been added to NETUTILSPARSER lib mappers.""" assert parser_map.keys() == lib_mapper.NETUTILSPARSER_LIB_MAPPER.keys() assert list(parser_map.keys()) == sorted(list(lib_mapper.NETUTILSPARSER_LIB_MAPPER.keys())) From 9e32c89862413000b3a686af0b12c4f034d3fb96 Mon Sep 17 00:00:00 2001 From: Adam Byczkowski <38091261+qduk@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:12:50 -0600 Subject: [PATCH 2/2] Docs updated --- docs/user/lib_mapper/ansible_reverse.md | 1 + docs/user/lib_mapper/napalm.md | 2 +- docs/user/lib_mapper/napalm_reverse.md | 3 ++- docs/user/lib_mapper/netutilsparser.md | 2 +- docs/user/lib_mapper/netutilsparser_reverse.md | 2 +- docs/user/lib_mapper/pyats_reverse.md | 1 + docs/user/lib_mapper/pyntc_reverse.md | 1 + 7 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/user/lib_mapper/ansible_reverse.md b/docs/user/lib_mapper/ansible_reverse.md index c7c9c873..bfb21439 100644 --- a/docs/user/lib_mapper/ansible_reverse.md +++ b/docs/user/lib_mapper/ansible_reverse.md @@ -6,6 +6,7 @@ | cisco_asa | → | cisco.asa.asa | | cisco_ios | → | cisco.ios.ios | | cisco_nxos | → | cisco.nxos.nxos | +| cisco_xe | → | cisco.ios.ios | | cisco_xr | → | cisco.iosxr.iosxr | | dell_os10 | → | dellemc.os10.0s10 | | dell_os6 | → | dellemc.os6.os6 | diff --git a/docs/user/lib_mapper/napalm.md b/docs/user/lib_mapper/napalm.md index 9625bd41..185bff0a 100644 --- a/docs/user/lib_mapper/napalm.md +++ b/docs/user/lib_mapper/napalm.md @@ -6,7 +6,7 @@ | eos | → | arista_eos | | f5 | → | bigip_f5 | | fortios | → | fortinet | -| huawei | → | huawei_vrp | +| huawei_vrp | → | huawei | | ios | → | cisco_ios | | iosxr | → | cisco_xr | | junos | → | juniper_junos | diff --git a/docs/user/lib_mapper/napalm_reverse.md b/docs/user/lib_mapper/napalm_reverse.md index f929cd41..67811a1c 100644 --- a/docs/user/lib_mapper/napalm_reverse.md +++ b/docs/user/lib_mapper/napalm_reverse.md @@ -8,9 +8,10 @@ | cisco_ios | → | ios | | cisco_nxos | → | nxos | | cisco_wlc | → | cisco_wlc_ssh | +| cisco_xe | → | cisco_ios | | cisco_xr | → | iosxr | | fortinet | → | fortios | -| huawei_vrp | → | huawei | +| huawei | → | huawei_vrp | | juniper_junos | → | junos | | mikrotik_routeros | → | ros | | nokia_sros | → | sros | diff --git a/docs/user/lib_mapper/netutilsparser.md b/docs/user/lib_mapper/netutilsparser.md index 52f4d9db..cea138aa 100644 --- a/docs/user/lib_mapper/netutilsparser.md +++ b/docs/user/lib_mapper/netutilsparser.md @@ -6,7 +6,7 @@ | cisco_aireos | → | cisco_aireos | | cisco_asa | → | cisco_asa | | cisco_ios | → | cisco_ios | -| cisco_iosxr | → | cisco_iosxr | +| cisco_iosxr | → | cisco_xr | | cisco_nxos | → | cisco_nxos | | citrix_netscaler | → | citrix_netscaler | | extreme_netiron | → | extreme_netiron | diff --git a/docs/user/lib_mapper/netutilsparser_reverse.md b/docs/user/lib_mapper/netutilsparser_reverse.md index c6b2f36c..7db2c9b3 100644 --- a/docs/user/lib_mapper/netutilsparser_reverse.md +++ b/docs/user/lib_mapper/netutilsparser_reverse.md @@ -6,8 +6,8 @@ | cisco_aireos | → | cisco_aireos | | cisco_asa | → | cisco_asa | | cisco_ios | → | cisco_ios | -| cisco_iosxr | → | cisco_iosxr | | cisco_nxos | → | cisco_nxos | +| cisco_xr | → | cisco_iosxr | | citrix_netscaler | → | citrix_netscaler | | extreme_netiron | → | extreme_netiron | | fortinet_fortios | → | fortinet_fortios | diff --git a/docs/user/lib_mapper/pyats_reverse.md b/docs/user/lib_mapper/pyats_reverse.md index d26bd04f..dddad0bb 100644 --- a/docs/user/lib_mapper/pyats_reverse.md +++ b/docs/user/lib_mapper/pyats_reverse.md @@ -5,6 +5,7 @@ | cisco_ios | → | iosxe | | cisco_nxos | → | nxos | | cisco_viptella | → | viptela | +| cisco_xe | → | iosxe | | cisco_xr | → | iosxr | | f5_tmsh | → | bigip | | juniper_junos | → | junos | diff --git a/docs/user/lib_mapper/pyntc_reverse.md b/docs/user/lib_mapper/pyntc_reverse.md index 9615063b..80691ee5 100644 --- a/docs/user/lib_mapper/pyntc_reverse.md +++ b/docs/user/lib_mapper/pyntc_reverse.md @@ -5,5 +5,6 @@ | cisco_ios | → | cisco_ios_ssh | | cisco_nxos | → | cisco_nxos_nxapi | | cisco_wlc | → | cisco_aireos_ssh | +| cisco_xe | → | cisco_ios_ssh | | f5_tmsh | → | f5_tmos_icontrol | | juniper_junos | → | juniper_junos_netconf | \ No newline at end of file