image-info: sort partitions list in the report.

Ensure that the list of partitions in the report is always sorted. Use
'partuuid' as the sorting key.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2021-09-20 14:35:08 +02:00 committed by Achilleas Koutsou
parent 02b706b673
commit 7b37c92bea

View file

@ -269,6 +269,7 @@ def read_partition_table(device):
"partuuid": partuuid
})
info["partitions"] = sorted(info["partitions"], key=operator.itemgetter("partuuid"))
info["partition-table"] = ptable["label"]
info["partition-table-id"] = ptable["id"]