[PATCH 2/4] Include device id in log lines since partitions can get renumbered.

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

 



---
 storage/devicetree.py   |   10 ++++++----
 storage/partitioning.py |   21 +++++++++++++--------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 1436aba..07b9e0c 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -722,8 +722,9 @@ class DeviceTree(object):
                 raise DeviceTreeError("parent device not in tree")
 
         self._devices.append(newdev)
-        log.debug("added %s (%s) to device tree" % (newdev.name,
-                                                    newdev.type))
+        log.debug("added %s %s (id %d) to device tree" % (newdev.type,
+                                                          newdev.name,
+                                                          newdev.id))
 
     def _removeDevice(self, dev, force=None, moddisk=True):
         """ Remove a device from the tree.
@@ -758,8 +759,9 @@ class DeviceTree(object):
                     device.updateName()
 
         self._devices.remove(dev)
-        log.debug("removed %s (%s) from device tree" % (dev.name,
-                                                        dev.type))
+        log.debug("removed %s %s (id %d) from device tree" % (dev.type,
+                                                              dev.name,
+                                                              dev.id))
 
         for parent in dev.parents:
             # Will this cause issues with garbage collection?
diff --git a/storage/partitioning.py b/storage/partitioning.py
index a1c1709..e1c2a8d 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -658,8 +658,9 @@ def allocatePartitions(disks, partitions):
         The PartitionDevice instances will have their name and parents
         attributes set once they have been allocated.
     """
-    log.debug("allocatePartitions: disks=%s ; partitions=%s" % (disks,
-                                                                partitions))
+    log.debug("allocatePartitions: disks=%s ; partitions=%s" %
+                ([d.name for d in disks],
+                 ["%s(id %d)" % (p.name, p.id) for p in partitions]))
     new_partitions = [p for p in partitions if not p.exists]
     new_partitions.sort(cmp=partitionCompare)
 
@@ -706,10 +707,12 @@ 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 ; id: %d ; disks: %s ;\n"
+                  "boot: %s ; primary: %s ; size: %dMB ; grow: %s ; "
+                  "max_size: %s" % (_part.name, _part.id, 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
@@ -892,7 +895,8 @@ def growPartitions(disks, partitions):
                           instances)
     """
     log.debug("growPartitions: disks=%s, partitions=%s" %
-            ([d.name for d in disks], [p.name for p in partitions]))
+            ([d.name for d in disks],
+             ["%s(id %d)" % (p.name, p.id) for p in partitions]))
     all_growable = [p for p in partitions if p.req_grow]
     if not all_growable:
         return
@@ -900,7 +904,8 @@ def growPartitions(disks, partitions):
     # sort requests by base size in decreasing order
     all_growable.sort(key=lambda p: p.req_size, reverse=True)
 
-    log.debug("growable requests are %s" % [p.name for p in all_growable])
+    log.debug("growable requests are %s" %
+                ["%s(id %d)" % (p.name, p.id) for p in all_growable])
 
     for disk in disks:
         log.debug("growing requests on %s" % disk.name)
-- 
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