linux/tools/net/ynl
Donald Hunter 771b7012e5 tools/net/ynl: Report netlink errors without stacktrace
ynl does not handle NlError exceptions so they get reported like program
failures. Handle the NlError exceptions and report the netlink errors
more cleanly.

Example now:

Netlink error: No such file or directory
nl_len = 44 (28) nl_flags = 0x300 nl_type = 2
	error: -2	extack: {'bad-attr': '.op'}

Example before:

Traceback (most recent call last):
  File "/home/donaldh/net-next/./tools/net/ynl/cli.py", line 81, in <module>
    main()
  File "/home/donaldh/net-next/./tools/net/ynl/cli.py", line 69, in main
    reply = ynl.dump(args.dump, attrs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/donaldh/net-next/tools/net/ynl/lib/ynl.py", line 906, in dump
    return self._op(method, vals, [], dump=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/donaldh/net-next/tools/net/ynl/lib/ynl.py", line 872, in _op
    raise NlError(nl_msg)
lib.ynl.NlError: Netlink error: No such file or directory
nl_len = 44 (28) nl_flags = 0x300 nl_type = 2
	error: -2	extack: {'bad-attr': '.op'}

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20240306231046.97158-3-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-03-07 20:28:26 -08:00
..
generated tools: ynl: rename make hardclean -> distclean 2024-03-06 12:05:10 +00:00
lib tools/net/ynl: Report netlink errors without stacktrace 2024-03-07 20:28:26 -08:00
samples tools: ynl: add distclean to .PHONY in all makefiles 2024-03-06 12:05:10 +00:00
cli.py tools/net/ynl: Report netlink errors without stacktrace 2024-03-07 20:28:26 -08:00
ethtool.py tools: ynl: Rename ethtool to ethtool.py 2023-04-13 22:18:29 -07:00
Makefile tools: ynl: add distclean to .PHONY in all makefiles 2024-03-06 12:05:10 +00:00
Makefile.deps tools: ynl: protect from old OvS headers 2024-02-28 15:24:11 -08:00
requirements.txt tools: ynl: add the Python requirements.txt file 2023-03-24 19:11:02 -07:00
ynl-gen-c.py tools: ynl: remove the libmnl dependency 2024-02-28 15:25:45 -08:00
ynl-gen-rst.py tools/net/ynl: Add type info to struct members in generated docs 2024-01-31 21:19:19 -08:00
ynl-regen.sh tools: ynl: don't skip regeneration from make targets 2023-11-29 16:07:00 -08:00