[PATCH] Esthetic changes to storage/partitioning.py.

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

 



Mostly log calls that ran for more than 80 char lines.
---
 storage/partitioning.py |   47 ++++++++++++++++++++++++++++-------------------
 1 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 1bd7807..eba0cb7 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -472,13 +472,15 @@ def getBestFreeSpaceRegion(disk, part_type, req_size,
             best_free -- current best free region for this partition
 
     """
-    log.debug("getBestFreeSpaceRegion: disk=%s part_type=%d req_size=%dMB boot=%s best=%s" % (disk.device.path, part_type, req_size, boot, best_free))
+    log.debug("getBestFreeSpaceRegion: disk=%s part_type=%d req_size=%dMB boot=%s best=%s" %
+            (disk.device.path, part_type, req_size, boot, best_free))
     extended = disk.getExtendedPartition()
     for _range in disk.getFreeSpaceRegions():
         if extended:
             # find out if there is any overlap between this region and the
             # extended partition
-            log.debug("looking for intersection between extended (%d-%d) and free (%d-%d)" % (extended.geometry.start, extended.geometry.end, _range.start, _range.end))
+            log.debug("looking for intersection between extended (%d-%d) and free (%d-%d)" %
+                    (extended.geometry.start, extended.geometry.end, _range.start, _range.end))
 
             # parted.Geometry.overlapsWith can handle this
             try:
@@ -612,7 +614,11 @@ def allocatePartitions(disks, partitions):
                 continue
             #_part.disk.partedDisk.removePartition(_part.partedPartition)
             partedDisk = partedDisks[_part.disk.partedDisk.device.path]
-            #log.debug("removing part %s (%s) from disk %s (%s)" % (_part.partedPartition.path, [p.path for p in _part.partedPartition.disk.partitions], partedDisk.device.path, [p.path for p in partedDisk.partitions]))
+            #log.debug("removing part %s (%s) from disk %s (%s)" %
+            #          (_part.partedPartition.path,
+            #           [p.path for p in _part.partedPartition.disk.partitions],
+            #           partedDisk.device.path,
+            #           [p.path for p in partedDisk.partitions]))
             if not partedDisk.getPartitionByPath(_part.path):
                 continue
 
@@ -641,7 +647,10 @@ def allocatePartitions(disks, partitions):
             # no disks specified means any disk will do
             req_disks = disks
 
-        log.debug("allocating partition: %s ; disks: %s ; boot: %s ; primary: %s ; size: %dMB ; grow: %s ; max_size: %s" % (_part.name, req_disks, _part.req_bootable, _part.req_primary, _part.req_size, _part.req_grow, _part.req_max_size))
+        log.debug("allocating partition: %s ; disks: %s ; boot: %s ; "
+                  "primary: %s ; size: %dMB ; grow: %s ; max_size: %s" %
+                  (_part.name, req_disks, _part.req_bootable, _part.req_primary,
+                   _part.req_size, _part.req_grow, _part.req_max_size))
         free = None
         use_disk = None
         part_type = None
@@ -675,7 +684,7 @@ def allocatePartitions(disks, partitions):
                                           _part.req_size,
                                           best_free=free,
                                           boot=_part.req_bootable)
-            
+
             if best == free and not _part.req_primary and \
                new_part_type == parted.PARTITION_NORMAL:
                 # see if we can do better with a logical partition
@@ -759,7 +768,8 @@ def allocatePartitions(disks, partitions):
         constraint = parted.Constraint(exactGeom=new_geom)
         disk.addPartition(partition=partition,
                           constraint=constraint)
-        log.debug("created partition %s of %dMB and added it to %s" % (partition.getDeviceNodeName(), partition.getSize(), disk))
+        log.debug("created partition %s of %dMB and added it to %s" %
+                (partition.getDeviceNodeName(), partition.getSize(), disk))
 
         # this one sets the name
         _part.partedPartition = partition
@@ -798,7 +808,8 @@ def growPartitions(disks, partitions):
             partitions -- a list of all partitions (PartitionDevice
                           instances)
     """
-    log.debug("growPartitions: disks=%s, partitions=%s" % ([d.name for d in disks], [p.name for p in partitions]))
+    log.debug("growPartitions: disks=%s, partitions=%s" %
+            ([d.name for d in disks], [p.name for p in partitions]))
     all_growable = [p for p in partitions if p.req_grow]
     if not all_growable:
         return
@@ -879,17 +890,14 @@ def growPartitions(disks, partitions):
                 max_grow += leftover_share * leftover
             max_sectors = req_sectors + max_grow
             max_mb = (max_sectors * sectorSize) / (1024 * 1024)
-            log.debug("%s: base_size=%dMB, max_size=%sMB" % (part.name,
-                                                             part.req_base_size,
-                                                             part.req_max_size))
-            log.debug("%s: current_size=%dMB (%d sectors)" % (part.name,
-                                                              part.partedPartition.getSize(),
-                                                              part.partedPartition.geometry.length))
-            log.debug("%s: %dMB (%d sectors, or %d%% of %d)" % (part.name,
-                                                                max_mb,
-                                                                max_sectors,
-                                                                share * 100,
-                                                                disk_free))
+
+            log.debug("%s: base_size=%dMB, max_size=%sMB" %
+                    (part.name, part.req_base_size,  part.req_max_size))
+            log.debug("%s: current_size=%dMB (%d sectors)" %
+                    (part.name, part.partedPartition.getSize(),
+                        part.partedPartition.geometry.length))
+            log.debug("%s: %dMB (%d sectors, or %d%% of %d)" %
+                    (part.name, max_mb, max_sectors, share * 100, disk_free))
 
             log.debug("checking constraints on max size...")
             # don't grow beyond the request's maximum size
@@ -912,7 +920,8 @@ def growPartitions(disks, partitions):
 
             # we can only grow as much as the largest free region on the disk
             if free[0].length < max_grow:
-                log.debug("largest free region: %d sectors (%dMB)" % (free[0].length, free[0].getSize()))
+                log.debug("largest free region: %d sectors (%dMB)" %
+                        (free[0].length, free[0].getSize()))
                 # FIXME: round down to nearest cylinder boundary
                 max_grow = free[0].length
                 max_sectors = req_sectors + max_grow
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux