diff options
author | David Lehman <dlehman@redhat.com> | 2009-04-30 12:20:02 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-04-30 15:56:51 -0500 |
commit | 8d29cf7c8291a9c13313a1b55747258bc9ee423d (patch) | |
tree | 3d0d2379549e0e56aedce80556d1d61796d004d0 | |
parent | e956fcb309aa47dd22a6e2678a740f098e454ee5 (diff) | |
download | anaconda-8d29cf7c8291a9c13313a1b55747258bc9ee423d.tar.gz anaconda-8d29cf7c8291a9c13313a1b55747258bc9ee423d.tar.xz anaconda-8d29cf7c8291a9c13313a1b55747258bc9ee423d.zip |
Fix action sorting for partitions on the same disk. (#498064)
-rw-r--r-- | storage/devicetree.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py index 71df344d9..318d588ba 100644 --- a/storage/devicetree.py +++ b/storage/devicetree.py @@ -526,7 +526,11 @@ class DeviceTree(object): # generally destroy partitions after lvs, vgs, &c elif isinstance(a1.device, PartitionDevice) and \ isinstance(a2.device, PartitionDevice): - ret = cmp(a2.device.name, a1.device.name) + if a1.device.disk == a2.device.disk: + ret = cmp(a2.device.partedPartition.number, + a1.device.partedPartition.number) + else: + ret = cmp(a2.device.name, a1.device.name) elif isinstance(a1.device, PartitionDevice) and \ not isinstance(a2.device, DiskDevice): ret = 1 @@ -605,7 +609,11 @@ class DeviceTree(object): # generally create partitions before other device types elif isinstance(a1.device, PartitionDevice) and \ isinstance(a2.device, PartitionDevice): - ret = cmp(a1.device.name, a2.device.name) + if a1.device.disk == a2.device.disk: + ret = cmp(a1.device.partedPartition.number, + a2.device.partedPartition.number) + else: + ret = cmp(a1.device.name, a2.device.name) elif isinstance(a1.device, PartitionDevice) and \ not isinstance(a2.device, DiskDevice): ret = -1 |