Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

show_mac_address-table - Output contains single dictionary #385

Closed
kevindasilva03 opened this issue Mar 7, 2019 · 2 comments · Fixed by #485
Closed

show_mac_address-table - Output contains single dictionary #385

kevindasilva03 opened this issue Mar 7, 2019 · 2 comments · Fixed by #485

Comments

@kevindasilva03
Copy link

ISSUE TYPE
  • Bug Report
TEMPLATE USING
Value DESTINATION_ADDRESS ([0-9a-fA-F]{4}\.[0-9a-fA-F]{4}\.[0-9a-fA-F]{4})
Value TYPE (\w+)
Value VLAN (\w+)
Value DESTINATION_PORT (\S+)

Start
  ^Destination\s+Address\s+Address\s+Type\s+VLAN\s+Destination\s+Port -> TYPE1
  ^\s+vlan\s+mac address\s+type\s+learn\s+age\s+ports -> TYPE2
  ^\s+vlan\s+mac address\s+type\s+protocols\s+port -> TYPE3
  ^Vlan\s+Mac Address\s+Type\s+Ports -> TYPE4

TYPE1
  ^${DESTINATION_ADDRESS}\s+${TYPE}\s+${VLAN}\s+${DESTINATION_PORT} -> Record

TYPE2
  ^[\*|\s]\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+\S+\s+${DESTINATION_PORT} -> Record

TYPE3
  ^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+${DESTINATION_PORT} -> Record

TYPE4
  ^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT} -> Record

SAMPLE COMMAND OUTPUT
dd-r-vss#sh mac address-table
Unicast Entries
 vlan     mac address     type        protocols               port
---------+---------------+--------+---------------------+-------------------------
 950      0008.e3ff.fca8    static ip,ipx,assigned,other Switch
1105      0008.e3ff.fca8    static ip,ipx,assigned,other Switch
1105      0008.e3ff.fcac   dynamic ip,ipx,assigned,other Port-channel30
1106      0008.e3ff.fca8    static ip,ipx,assigned,other Switch
1106      002a.6a8b.e343   dynamic ip,ipx,assigned,other TenGigabitEthernet1/1/1
1171      0008.e3ff.fca8    static ip,ipx,assigned,other Switch
1171      001b.baf8.ca15   dynamic ip,ipx,assigned,other Port-channel41
1171      001b.baf8.ca31   dynamic ip,ipx,assigned,other Port-channel41

SUMMARY

When using this template, the output only produces a list of 1 dictionary of the first entry of the show mac address-table command. FYI... This is in conjunction with the Netmiko

STEPS TO REPRODUCE

mac_int_output = net_conn.send_command("show mac address-table", use_textfsm=True)

EXPECTED RESULTS

[{'destination_address': '0008.e3ff.fca8',
'type': 'static',
'vlan': '950',
'destination_port': 'Switch'}]
[{'destination_address': '0008.e3ff.fca8',
'type': 'static',
'vlan': '1105',
'destination_port': 'Switch'}]

ACTUAL RESULTS
[{'destination_address': '0008.e3ff.fca8',
  'type': 'static',
  'vlan': '950',
  'destination_port': 'Switch'}]
@ktbyers
Copy link
Contributor

ktbyers commented Mar 7, 2019

See ktbyers/netmiko#1126

@FragmentedPacket
Copy link
Contributor

@kevindasilva03 Do you mind contributing the fix via PR to this repo?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants