summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-03-07 20:59:16 +0300
committerJakub Kicinski <kuba@kernel.org>2026-03-11 03:54:02 +0300
commitb8a0e5eb6a126a641ab8768e825756a66848ca29 (patch)
tree49dc868fe4d556cd5a1d78dca4153c3a5d0ba119 /tools
parent16767c72a40f524fbd0441386f2c3b6f5ff283b0 (diff)
downloadlinux-b8a0e5eb6a126a641ab8768e825756a66848ca29.tar.xz
tools: ynl: cli: order set->list conversion in JSON output
NIPA tries to make sure that HW tests don't modify system state. It dumps some well known configs before and after the test and compares the outputs. Make sure that YNL json output is stable. Converting sets to lists with a naive list(o) results in a random order. Link: https://patch.msgid.link/20260307175916.1652518-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/net/ynl/pyynl/cli.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/net/ynl/pyynl/cli.py b/tools/net/ynl/pyynl/cli.py
index 94a5ba348b69..b452d4fb9434 100755
--- a/tools/net/ynl/pyynl/cli.py
+++ b/tools/net/ynl/pyynl/cli.py
@@ -78,7 +78,7 @@ class YnlEncoder(json.JSONEncoder):
if isinstance(o, bytes):
return bytes.hex(o)
if isinstance(o, set):
- return list(o)
+ return sorted(o)
return json.JSONEncoder.default(self, o)