]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools: ynl: parse extack for sub-messages
authorDonald Hunter <donald.hunter@gmail.com>
Fri, 23 May 2025 10:30:31 +0000 (11:30 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 28 May 2025 00:31:42 +0000 (17:31 -0700)
commit09d7ff0694ea133c50ad905fd6e548c13f8af458
tree0714040382108af03f47599c0dd606a71c389483
parent8bc3c234dcb65a018120dab96c83845cc7ff35c6
tools: ynl: parse extack for sub-messages

Extend the Python YNL extack decoding to handle sub-messages in the same
way that YNL C does. This involves retaining the input values so that
they are available during extack decoding.

./tools/net/ynl/pyynl/cli.py --family rt-link --do newlink --create \
    --json '{
        "linkinfo": {"kind": "netkit", "data": {"policy": 10} }
    }'
Netlink error: Invalid argument
nl_len = 92 (76) nl_flags = 0x300 nl_type = 2
error: -22
extack: {'msg': 'Provided default xmit policy not supported', 'bad-attr': '.linkinfo.data(netkit).policy'}

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://patch.msgid.link/20250523103031.80236-1-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/pyynl/lib/ynl.py