From 2f081e91c893d3e57fbdcc65be0989d533304c45 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 3 Nov 2014 13:07:29 -0800 Subject: [PATCH] disk_util: ensure partitions are layed out on disk in order So far the default iteration order of python dicts has mostly matched the order that we want the partitions on disk but this is not always the case. I caught the BIOS-BOOT partition being ordered on disk after the USR-A partition. Nothing bad came of this but consistancy is good. --- build_library/disk_util | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/disk_util b/build_library/disk_util index 61c177778e..dd0054564d 100755 --- a/build_library/disk_util +++ b/build_library/disk_util @@ -127,7 +127,7 @@ def LoadPartitionConfig(options): for base_key, base_value in base_part.iteritems(): part.setdefault(base_key, base_value) - for part_num, part in layout.iteritems(): + for part_num, part in sorted(layout.iteritems(), key=lambda t: int(t[0])): if part['type'] == 'blank': continue