Closed udaltsov-dm closed 7 years ago
I think it is probably more logical to fix this issue in napalm-junos.
The mac
function has a pretty delimited purpose i.e. standardizing the mac-address format (converting dot-format to standardized aa:bb...format).
This issue is more of a post processing issue on Juniper.
What is the purpose of that *
? Could you show an example? To me, getting the mac address table and getting a wildcard sounds weird. If it's UUF we should just filter that out and don't return it.
@udaltsov-dm if you have any examples, please paste here. I have mixed feelings if this should be here (i.e. we consider that '*' means 'FF:FF:FF:FF:FF:FF' on all platforms) or under napalm-junos if that's juniper specific thing (although I didn't see anything like that previously).
@mirceaulinic juniper switches use to indicate flooding capabilities for some vlan. Here are the example from junos ex 3300: ex-switch> show ethernet-switching table | match All Anl Flood - All-members App Flood - All-members Bulk-DATA Flood - All-members DB Flood - All-members DMZ Flood - All-members Deploy * Flood - All-members
Here the example of XML output
<mac-table-entry junos:style="brief">
<mac-vlan>Win</mac-vlan>
<mac-address>*</mac-address>
<mac-type>Flood</mac-type>
<mac-age>-</mac-age>
<mac-interfaces-list>
<mac-interfaces>All-members</mac-interfaces>
</mac-interfaces-list>
</mac-table-entry>
Probably it should be filtered in somewhere to mac addresses getting from the switch.
Yes, I think we should filter that out. Doesn't make much sense IMHO.
@dbarrosop should i create a separate ticket for napalm-junos? there only 2 strokes of code should be added in get_mac_address_table function of junos.py file.
mac = mac_entry.get('mac')
if mac == u'*':
continue
yes, you can send a PR if you prefer. You seem to know what needs to be done :)
@udaltsov-dm I am closing this, please submit the PR to napalm-junos at your will. Thanks!
The code is crashing with traceback: asw04-2:
The reason of it is following: Juniper EX switches have a mac-address which is indicate flooding capabilities for listed vlan. The simple fix should be applied in helpers.py in function mac. If we faced with mac address we should change it to something valid, for example FF:FF:FF:FF:FF:FF.
if raw.endswith(':'): flat_raw = raw.replace(':', '') raw = '{flat_raw}{zeros_stuffed}'.format( flat_raw=flat_raw, zeros_stuffed='0'*(12-len(flat_raw)) )
return py23_compat.text_type(EUI(raw, dialect=_MACFormat))