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

Re: [PATCH 03/14] Add the serial number to all DiskDevices and subclasses.



Ack.

On 12/01/2009 09:15 PM, Chris Lumens wrote:
---
  storage/devices.py    |    6 ++++--
  storage/devicetree.py |    2 +-
  2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index b4a518e..b5f7aee 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -716,7 +716,7 @@ class DiskDevice(StorageDevice):

      def __init__(self, device, format=None,
                   size=None, major=None, minor=None, sysfsPath='', \
-                 parents=None):
+                 parents=None, serial=None):
          """ Create a DiskDevice instance.

              Arguments:
@@ -732,13 +732,15 @@ class DiskDevice(StorageDevice):
                  format -- a DeviceFormat instance
                  parents -- a list of required Device instances
                  removable -- whether or not this is a removable device
+                serial -- the ID_SERIAL_SHORT for this device


              DiskDevices always exist.
          """
          StorageDevice.__init__(self, device, format=format, size=size,
                                 major=major, minor=minor, exists=True,
-                               sysfsPath=sysfsPath, parents=parents)
+                               sysfsPath=sysfsPath, parents=parents,
+                               serial=serial)

      def __str__(self):
          s = StorageDevice.__str__(self)
diff --git a/storage/devicetree.py b/storage/devicetree.py
index b528ab2..7fb9f47 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1213,7 +1213,7 @@ class DeviceTree(object):
              diskType = DiskDevice
              log.debug("%s is a disk" % name)

-        device = diskType(name,
+        device = diskType(name, serial=serial,
                            major=udev_device_get_major(info),
                            minor=udev_device_get_minor(info),
                            sysfsPath=sysfs_path, **kwargs)


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