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 <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2022-05-17 07:47:58 -04:00
parent e3ed783359
commit 734c345457
1 changed files with 1 additions and 1 deletions

View File

@ -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: