[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH][all branches] Remove partitions before unpartitoned non-partition devices. (#588597)



---
 storage/devicetree.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 03827df..e14551e 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -535,6 +535,14 @@ class DeviceTree(object):
                 elif isinstance(a2.device, PartitionDevice) and \
                      a1.device.partitioned:
                     ret = -1
+                # remove partitions before unpartitioned non-partition
+                # devices
+                elif isinstance(a1.device, PartitionDevice) and \
+                     not isinstance(a2.device, PartitionDevice):
+                    ret = 1
+                elif isinstance(a2.device, PartitionDevice) and \
+                     not isinstance(a1.device, PartitionDevice):
+                    ret = -1
                 else:
                     ret = 0
             elif a1.isDestroy():
-- 
1.6.6.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]