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

[PATCH 1/2] Align extended partitions like we do other partitions.



---
 storage/partitioning.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 87154ee..70cd75d 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -689,13 +689,15 @@ def addPartition(disklabel, free, part_type, size):
 
     if part_type == parted.PARTITION_EXTENDED:
         end = free.end
+        length = end - start + 1
     else:
         # size is in MB
         length = sizeToSectors(size, disklabel.partedDevice.sectorSize)
         end = start + length - 1
-        if not disklabel.endAlignment.isAligned(free, end):
-            end = disklabel.endAlignment.alignNearest(free, end)
-            log.debug("adjusted length from %d to %d" % (length, end - start + 1))
+
+    if not disklabel.endAlignment.isAligned(free, end):
+        end = disklabel.endAlignment.alignNearest(free, end)
+        log.debug("adjusted length from %d to %d" % (length, end - start + 1))
 
     new_geom = parted.Geometry(device=disklabel.partedDevice,
                                start=start,
-- 
1.6.6


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