summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMatthieu Baerts (NGI0) <matttbe@kernel.org>2025-09-09 23:07:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 12:03:56 +0200
commitf6ca78b7536116dba14e87abcca2197b70548b6b (patch)
tree518d826cb5c8a9400842e2c56c573f59329c7dcf /tools
parentcc93a995e446cccf46c3bdc30f539baa77c24c62 (diff)
downloadlinux-f6ca78b7536116dba14e87abcca2197b70548b6b.tar.gz
linux-f6ca78b7536116dba14e87abcca2197b70548b6b.tar.bz2
linux-f6ca78b7536116dba14e87abcca2197b70548b6b.zip
tools: ynl: fix undefined variable name
[ Upstream commit 7a3aaaa9fce710938c3557e5708ba5b00dd38226 ] This variable used in the error path was not defined according to Ruff. msg_format.attr_set is used instead, presumably the one that was supposed to be used originally. This is linked to Ruff error F821 [1]: An undefined name is likely to raise NameError at runtime. Fixes: 1769e2be4baa ("tools/net/ynl: Add 'sub-message' attribute decoding to ynl") Link: https://docs.astral.sh/ruff/rules/undefined-name/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-1-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/net/ynl/pyynl/lib/ynl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py
index 8244a5f440b2..15ddb0b1adb6 100644
--- a/tools/net/ynl/pyynl/lib/ynl.py
+++ b/tools/net/ynl/pyynl/lib/ynl.py
@@ -746,7 +746,7 @@ class YnlFamily(SpecFamily):
subdict = self._decode(NlAttrs(attr.raw, offset), msg_format.attr_set)
decoded.update(subdict)
else:
- raise Exception(f"Unknown attribute-set '{attr_space}' when decoding '{attr_spec.name}'")
+ raise Exception(f"Unknown attribute-set '{msg_format.attr_set}' when decoding '{attr_spec.name}'")
return decoded
def _decode(self, attrs, space, outer_attrs = None):