Minxi Hou <[email protected]> writes: > This series cleans up all pylint warnings in ovs-dpctl.py, > bringing the score from 7.62/10 to 10.00/10. > > This series applies on top of: > [PATCH net-next v10 1/2] selftests: openvswitch: add vlan() and > encap() flow string parsing > https://lore.kernel.org/netdev/[email protected]/ > > Patch 1 converts 86 %-format strings to f-strings. > Patch 2 fixes misc warnings (unused import, bare except, unused > variables, redundant expressions). > Patch 3 renames classes to PascalCase and variables to snake_case. > Patch 4 adds one-line docstrings to all definitions. > Patch 5 suppresses complexity warnings from pyroute2 constraints. > > Tested with vng on x86_64, all OVS selftests pass. > > Minxi Hou (5): > selftests: openvswitch: convert %-formatting to f-strings > selftests: openvswitch: fix misc pylint warnings in ovs-dpctl.py > selftests: openvswitch: rename classes and variables in ovs-dpctl.py > selftests: openvswitch: add missing docstrings in ovs-dpctl.py > selftests: openvswitch: suppress pylint complexity warnings > > .../selftests/net/openvswitch/ovs-dpctl.py | 794 ++++++++++-------- > 1 file changed, 428 insertions(+), 366 deletions(-)
Thinking about this series, it might be better to go a bit further and just drop the pyroute2 in favor of using ynl to generate the netlink encode/decode. The value that ovs-dpctl.py brings is the ability to interoperate with the ovs-vswitchd odp encoding. That we are using pyroute2 to do the actual 'wire' format of netlink is incidental. Some of the work would still be needed (I think some of the f-string adjustments) but that would allow trimming a good chunk of the code and let us just rely on the in-tree ynl rather than pyroute2 dependency. WDYT? Ilya and I can work with you offline if you are interested in pursuing this approach. I think it should make the overall code much better to work with, too.

