Merge pull request #724 from mwhudson/partition-order
ensure partitions are emitted in order
This commit is contained in:
commit
6990caadfd
|
@ -1487,6 +1487,11 @@ class FilesystemModel(object):
|
|||
next_work.append(part)
|
||||
|
||||
def can_emit(obj):
|
||||
if obj.type == "partition":
|
||||
ensure_partitions(obj.device)
|
||||
for p in obj.device.partitions():
|
||||
if p._number < obj._number and p.id not in emitted_ids:
|
||||
return False
|
||||
for dep in dependencies(obj):
|
||||
if dep.id not in emitted_ids:
|
||||
if dep not in work and dep not in next_work:
|
||||
|
|
|
@ -128,6 +128,7 @@ class PartitionViewTests(unittest.TestCase):
|
|||
model, disk = make_model_and_disk()
|
||||
partition = model.add_partition(disk, 512*(2**20))
|
||||
partition.preserve = True
|
||||
partition.number = 1
|
||||
fs = model.add_filesystem(partition, "ext4")
|
||||
model._orig_config = model._render_actions()
|
||||
fs.preserve = True
|
||||
|
|
Loading…
Reference in New Issue