Add a reasonably tolerant .pylintrc and fix most pylint errors and
warnings.
------------------------------------------------------------------
Your code has been rated at 9.78/10
Used:
$ flynt -a -tc . vppcfg
Execution time: 0.216s
Files checked: 24
Files modified: 13
Character count reduction: 632 (0.36%)
Per expression type:
Old style (`%`) expressions attempted: 209/211 (99.1%)
No `.format(...)` calls attempted.
No concatenations attempted.
F-string expressions created: 205
Ran an integration test before and after. No diffs.
- add __vxlan_tunnel_has_diff() to align with the other _has_diff()
methods
- factor out a few repetitive occurences of l2xc creations
- strictly make "cli=" the pattern instead of "cli = ", to help grepping :)
- based on previously submitted schema and validation, can add a TAP
with host netns, bridge and MTU.
- detect diffs in __tap_has_diff(), used to prune TAPs that must change
- add prune_taps() and create_taps() in the reconciler
- add Dumper() logic to emit YAML config for TAPs
- Move tap_is_lcp() into the VPPApi() class, so it can be reused
Add lots of test cases in intest/*.yaml and example.yaml - full
regression and integration and unit/YAML tests pass on this change.
- Cannot have LCP, Address or Sub-Interface
- Cannot be PHY
- Cannot be Bond member
- Can be target of L2XC
- Can be member of Bridge
- interface.mtu must be the same as tap.host.mtu
Add YAML tests for common mistakes. This unblocks taps becoming members
of a bridgedomain, and allowing a very cool feature: slowpath networking!
VPPApiDumper() is its own file, preparing for VPPApiApplier() in an
upcoming commit. VPPApi() itself remains read-only. No need for an empty
__init__.py file.
Update vppcfg to use the correct vpp/dumper.py import
Special care is taken for bondethernet, where the MAC changes when
the first member is added to it. BondEthernet requires its MAC to
be set in the bondethernets section, disallowing the MAC of individual
members to be set.
Also write a dumper for MACs of all types. Update integration test
cases to stress the MAC changes on loops, bonds, and phys.
Add int_to_mode() and int_to_lb() in config/bondethernet.py to map back
the retrieved values from VPP into their config strings.
Implement bond and bridge settings dumper, dumping all settings even if
they are default. This helps the user understand the configurable
options.