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.
This commit is contained in:
Michael Marineau 2014-11-03 13:07:29 -08:00
parent edae8bb5e0
commit 2f081e91c8

View File

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