Skip to content

Commit

Permalink
Update to handle Cisco ISR mac address table with multiple EHWIC mod… (
Browse files Browse the repository at this point in the history
…#996)

* Update to handle Cisco ISR mac address table  with multiple EHWIC modules installed

* Fixed a c/p error when creating this fork - missed a 'continue' line

* Ran black to reformat file

* Added testcase for mac-address-table with multiple EHWIC modules

* Updated format of expected MAC output as per @mirceaulinic's recommendation

Co-authored-by: Brad Ellis <brad.ellis@cengn.ca>
Co-authored-by: Mircea Ulinic <mirceaulinic@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 20, 2020
1 parent 8b1e986 commit 7b704b5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions napalm/ios/ios.py
Expand Up @@ -2633,6 +2633,14 @@ def process_mac_fields(vlan, mac, mac_type, interface):
r"Displaying entries from active supervisor:\s+\w+\s+\[\d\]:", line
):
continue
elif re.search(r"EHWIC:.*", line):
# Skip module - process_mac_fields doesn't care.
continue
elif re.search(
r"Destination Address.*Address.*Type.*VLAN.*Destination.*Port", line
):
# If there are multiple modules, this line gets repeated for each module.
continue
else:
raise ValueError("Unexpected output from: {}".format(repr(line)))

Expand Down
@@ -0,0 +1,18 @@
[{
"static": false,
"active": true,
"vlan": 2,
"mac": "11:11:22:22:33:33",
"interface": "GigabitEthernet0/0/1",
"moves": -1,
"last_move": -1.0
},
{
"static": false,
"active": true,
"vlan": 1,
"mac": "33:33:22:22:11:11",
"interface": "GigabitEthernet0/1/1",
"moves": -1,
"last_move": -1.0
}]
@@ -0,0 +1,9 @@
EHWIC: 0
Destination Address Address Type VLAN Destination Port
------------------- ------------ ---- -----------------
1111.2222.3333 Dynamic 2 GigabitEthernet0/0/1

EHWIC: 1
Destination Address Address Type VLAN Destination Port
------------------- ------------ ---- -----------------
3333.2222.1111 Dynamic 1 GigabitEthernet0/1/1

0 comments on commit 7b704b5

Please sign in to comment.