From 734c3454578d4db89b7a879b7339559b20c04c44 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Tue, 17 May 2022 07:47:58 -0400 Subject: [PATCH] twister: sort hardware map based on id Serial is not required, in some cases it might be set to null or we might be using serial_pty, so sort existing map file based on ID instead. Fixes #45713 Signed-off-by: Anas Nashif --- scripts/pylib/twister/twisterlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib.py b/scripts/pylib/twister/twisterlib.py index 5386c94f8fb..07045906f60 100755 --- a/scripts/pylib/twister/twisterlib.py +++ b/scripts/pylib/twister/twisterlib.py @@ -4640,7 +4640,7 @@ class HardwareMap: with open(hwm_file, 'r') as yaml_file: hwm = yaml.load(yaml_file, Loader=SafeLoader) if hwm: - hwm.sort(key=lambda x: x.get('serial', '')) + hwm.sort(key=lambda x: x.get('id', '')) # disconnect everything for h in hwm: