Skip to content

Commit fccd449

Browse files
committed
fixes #795, fixes #775, fixes #596
1 parent 1f0c88a commit fccd449

8 files changed

Lines changed: 77 additions & 2 deletions

File tree

changes/775.adderd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added a library mapping for `ncclient` which is used for NETCONF communication.

changes/775.fixed

Whitespace-only changes.

development_scripts.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@
120120
"_dict": lib_mapper.NAPALM_LIB_MAPPER_REVERSE,
121121
"_file": "docs/user/lib_mapper/napalm_reverse.md",
122122
},
123+
"ncclient": {
124+
"header_src": "NCCLIENT",
125+
"header_dst": "NORMALIZED",
126+
"_dict": lib_mapper.NCCLIENT_LIB_MAPPER,
127+
"_file": "docs/user/lib_mapper/ncclient.md",
128+
},
129+
"ncclient_reverse": {
130+
"header_src": "NORMALIZED",
131+
"header_dst": "NCCLIENT",
132+
"_dict": lib_mapper.NCCLIENT_LIB_MAPPER_REVERSE,
133+
"_file": "docs/user/lib_mapper/ncclient_reverse.md",
134+
},
123135
"netmiko": {
124136
"header_src": "NETMIKO",
125137
"header_dst": "NORMALIZED",

docs/user/lib_mapper/ansible.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
| arubanetworks.aoscx || aruba_aoscx |
77
| ciena.saos6.saos6 || ciena_saos |
88
| cisco.asa.asa || cisco_asa |
9+
| cisco.catalystcenter || cisco_dnac |
910
| cisco.ios.ios || cisco_ios |
1011
| cisco.iosxr.iosxr || cisco_xr |
1112
| cisco.meraki.meraki || cisco_meraki |

docs/user/lib_mapper/ansible_reverse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
| bigip_f5 || f5networks.f5_bigip.bigip |
88
| ciena_saos || ciena.saos6.saos6 |
99
| cisco_asa || cisco.asa.asa |
10+
| cisco_dnac || cisco.catalystcenter |
1011
| cisco_ios || cisco.ios.ios |
1112
| cisco_meraki || cisco.meraki.meraki |
1213
| cisco_nxos || cisco.nxos.nxos |

docs/user/lib_mapper/ncclient.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
| NCCLIENT | | NORMALIZED |
2+
| ---------- | -- | ------ |
3+
| alu || alcatel_sros |
4+
| ciena || ciena_saos |
5+
| h3c || h3c_comware |
6+
| hpcomware || hp_comware |
7+
| huawei || huawei |
8+
| huaweiyang || huawei_vrp |
9+
| iosxe || cisco_xe |
10+
| iosxr || cisco_xr |
11+
| junos || juniper_junos |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
| NORMALIZED | | NCCLIENT |
2+
| ---------- | -- | ------ |
3+
| alcatel_sros || alu |
4+
| ciena_saos || ciena |
5+
| cisco_ios || iosxe |
6+
| cisco_nxos || nexus |
7+
| cisco_xe || iosxe |
8+
| cisco_xr || iosxr |
9+
| h3c_comware || h3c |
10+
| hp_comware || hpcomware |
11+
| huawei || huawei |
12+
| huawei_vrp || huaweiyang |
13+
| huawei_vrpv8 || huaweiyang |
14+
| juniper_junos || junos |
15+
| nokia_sros || alu |

netutils/lib_mapper.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@
178178
"brocade_nos": "brocade_nos",
179179
"brocade_vdx": "brocade_vdx",
180180
"brocade_vyos": "brocade_vyos",
181-
"casa_cmts": "casa_cmts",
182181
"calix_b6": "calix_b6",
182+
"casa_cmts": "casa_cmts",
183183
"cdot_cros": "cdot_cros",
184184
"centec_os": "centec_os",
185185
"checkpoint_gaia": "checkpoint_gaia",
@@ -291,8 +291,8 @@
291291
"ubiquiti_edgerouter": "ubiquiti_edgerouter",
292292
"ubiquiti_edgeswitch": "ubiquiti_edgeswitch",
293293
"ubiquiti_unifiswitch": "ubiquiti_unifiswitch",
294-
"vyatta_vyos": "vyatta_vyos",
295294
"vertiv_mph": "vertiv_mph",
295+
"vyatta_vyos": "vyatta_vyos",
296296
"vyos": "vyos",
297297
"watchguard_fireware": "watchguard_fireware",
298298
"yamaha": "yamaha",
@@ -402,6 +402,7 @@
402402
"arubanetworks.aoscx": "aruba_aoscx",
403403
"ciena.saos6.saos6": "ciena_saos",
404404
"cisco.asa.asa": "cisco_asa",
405+
"cisco.catalystcenter": "cisco_dnac",
405406
"cisco.ios.ios": "cisco_ios",
406407
"cisco.iosxr.iosxr": "cisco_xr",
407408
"cisco.meraki.meraki": "cisco_meraki",
@@ -522,6 +523,19 @@
522523
"SRX": "juniper_junos", # no reverse
523524
}
524525

526+
# NCCLIENT | Normalized
527+
NCCLIENT_LIB_MAPPER: t.Dict[str, str] = {
528+
"alu": "alcatel_sros",
529+
"ciena": "ciena_saos",
530+
"iosxe": "cisco_xe",
531+
"iosxr": "cisco_xr",
532+
"h3c": "h3c_comware",
533+
"huawei": "huawei",
534+
"huaweiyang": "huawei_vrp",
535+
"hpcomware": "hp_comware",
536+
"junos": "juniper_junos",
537+
}
538+
525539
# NIST | Normalized
526540
NIST_LIB_MAPPER: t.Dict[str, str] = {
527541
"arista:eos": "arista_eos",
@@ -578,6 +592,7 @@
578592
"bigip_f5": "f5networks.f5_bigip.bigip",
579593
"ciena_saos": "ciena.saos6.saos6",
580594
"cisco_asa": "cisco.asa.asa",
595+
"cisco_dnac": "cisco.catalystcenter",
581596
"cisco_ios": "cisco.ios.ios",
582597
"cisco_meraki": "cisco.meraki.meraki",
583598
"cisco_nxos": "cisco.nxos.nxos",
@@ -711,6 +726,23 @@
711726
"paloalto_panos": "paloaltonetworks:pan-os",
712727
}
713728

729+
# Normlized | NCCLIENT
730+
NCCLIENT_LIB_MAPPER_REVERSE: t.Dict[str, str] = {
731+
"alcatel_sros": "alu",
732+
"ciena_saos": "ciena",
733+
"cisco_ios": "iosxe",
734+
"cisco_nxos": "nexus",
735+
"cisco_xe": "iosxe",
736+
"cisco_xr": "iosxr",
737+
"h3c_comware": "h3c",
738+
"huawei": "huawei",
739+
"huawei_vrp": "huaweiyang",
740+
"huawei_vrpv8": "huaweiyang",
741+
"hp_comware": "hpcomware",
742+
"juniper_junos": "junos",
743+
"nokia_sros": "alu",
744+
}
745+
714746
# Deep copy the reverse, where there is no actual translation happening with special
715747
# consideration for OS's not in netmiko.
716748
_MAIN_LIB_MAPPER = copy.deepcopy(NETMIKO_LIB_MAPPER)
@@ -751,6 +783,7 @@
751783
"forward_networks": FORWARDNETWORKS_LIB_MAPPER,
752784
"hier_config": HIERCONFIG_LIB_MAPPER,
753785
"napalm": NAPALM_LIB_MAPPER,
786+
"ncclient": NCCLIENT_LIB_MAPPER,
754787
"netmiko": NETMIKO_LIB_MAPPER,
755788
"netutils_parser": NETUTILSPARSER_LIB_MAPPER,
756789
"nist": NIST_LIB_MAPPER,
@@ -769,6 +802,7 @@
769802
"forward_networks": FORWARDNETWORKS_LIB_MAPPER_REVERSE,
770803
"hier_config": HIERCONFIG_LIB_MAPPER_REVERSE,
771804
"napalm": NAPALM_LIB_MAPPER_REVERSE,
805+
"ncclient": NCCLIENT_LIB_MAPPER_REVERSE,
772806
"netmiko": NETMIKO_LIB_MAPPER_REVERSE,
773807
"netutils_parser": NETUTILSPARSER_LIB_MAPPER_REVERSE,
774808
"nist": NIST_LIB_MAPPER_REVERSE,

0 commit comments

Comments
 (0)