Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
disk_util: ensure partitions are layed out on disk in order
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marineam committed Nov 3, 2014
1 parent edae8bb commit 2f081e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build_library/disk_util
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2f081e9

Please sign in to comment.