mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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>
This commit is contained in:
parent
16767c72a4
commit
b8a0e5eb6a
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user