genieparser
genieparser copied to clipboard
Show mac address-table static
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
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/
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
inshow_fdb.py
has a scheme - the class
ShowMacAddressMacVlan
inshow_fdb.py
has another scheme - the class
ShowMacAddressTableDynamic
inshow_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?
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.