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

Re: [PATCH 1/3] Sort Storage.devices using isys.compareDrives for consistency.


On 12/22/2009 02:26 AM, David Lehman wrote:
  storage/__init__.py |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 2dbbfb8..bc63e43 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -370,7 +370,7 @@ class Storage(object):
      def devices(self):
          """ A list of all the devices in the device tree. """
          devices = self.devicetree.devices
-        devices.sort(key=lambda d: d.path)
+        devices.sort(key=lambda d: d.path, cmp=isys.compareDrives)
          return devices


Note that isys.compareDrives only works for
disks, and if something is not recognized it automatically gets
a lower prio then recognized thinks

So if the bios order is sdb, sda, and you pass in:

[ "sda", "sda1", "sdb", "sdb1" ]

You will end up with:

[ "sdb", "sda", "sda1", "sdb1" ]

IOW I'm not sure about this one.



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