genieparser icon indicating copy to clipboard operation
genieparser copied to clipboard

Show mac address-table static

Open DendoD96 opened this issue 2 years ago • 3 comments

Hi everyone, Genie parsers include those for obtaining the dynamic entries of the mac address table. Would it be possible to refactor the class to accept a type argument so that the same commands can be executed on static entries? This would allow to duplicate the code to manage the static entries.

Daniele

DendoD96 avatar Jun 13 '22 12:06 DendoD96

Hi @DendoD96 . Technically it is possible to do, as long as the refactored parser is backwards compatible.

We incentivize the members of the pyATS community to contribute.

If you want to make this enhancement you can refer to the documentation for more instructions on how to proceed: https://developer.cisco.com/docs/pyats-development-guide/

domachad avatar Jun 14 '22 14:06 domachad

Hi @domachad, I will certainly try to contribute. Looking at the code, I noticed that there are several schemes for very similar commands. For instance:

  • the class ShowMacAddressTable in show_fdb.py has a scheme
  • the class ShowMacAddressMacVlan in show_fdb.py has another scheme
  • the class ShowMacAddressTableDynamic in show_mac_address.py has another scheme

Should we integrate all commands (like sh mac address-table, sh mac address-table static/dynamic, sh mac address-table vlan ..., sh mac address-table address ... and their combinations) in a unique class and return the same scheme o mantenere la frammentazione attuale?

DendoD96 avatar Jun 16 '22 10:06 DendoD96

It's important to keep in mind that these parsers were developed by different people at different times. As long as the changes maintain backwards compatibility, making the code more uniform would be a great plus. I would recommend starting with a simple contribution and then you can build from there.

domachad avatar Jun 17 '22 15:06 domachad