Make all StorageDevice-s support .vendor and .model
Not everything has one, but this makes them all at least show "None"
instead of having to do the hasattr dance. Also, it now normally gets
the info from udev rather than using parted's concatenated version
(which fixes some minor UI problems as well as making it available at
more places.)
Also add a correct "model" method to MultipathDevice - we want to
display the model for the underlying disk device, not "linux device
mapper device" or whatnot.
---
storage/devices.py | 52 ++++++++++++++++++++++++++++++++++++++----------
storage/devicetree.py | 8 +++++-
2 files changed, 47 insertions(+), 13 deletions(-)
Arguments:
@@ -447,6 +447,10 @@ class StorageDevice(Device):
sysfsPath -- sysfs device path
format -- a DeviceFormat instance
parents -- a list of required Device instances
+ serial -- the ID_SERIAL_SHORT for this device
+ vendor -- the manufacturer of this Device
+ model -- manufacturer's device model string
+ bus -- the interconnect this device uses
"""
# allow specification of individual parents
@@ -462,8 +466,9 @@ class StorageDevice(Device):
self.major = numeric_type(major)
self.minor = numeric_type(minor)
self.sysfsPath = sysfsPath
- self.serial = serial
- self.vendor = vendor
+ self._serial = serial
+ self._vendor = vendor
+ self._model = model
self.bus = bus
self.protected = False
@@ -737,6 +742,19 @@ class StorageDevice(Device):
def partitioned(self):
return self.format.type == "disklabel" and self.partitionable
@@ -765,6 +783,7 @@ class DiskDevice(StorageDevice):
removable -- whether or not this is a removable device
serial -- the ID_SERIAL_SHORT for this device
vendor -- the manufacturer of this Device
+ model -- manufacturer's device model string
bus -- the interconnect this device uses
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
01-20-2010, 08:12 PM
Peter Jones
Make all StorageDevice-s support .vendor and .model
Not everything has one, but this makes them all at least show "None"
instead of having to do the hasattr dance. Also, it now normally gets
the info from udev rather than using parted's concatenated version
(which fixes some minor UI problems as well as making it available at
more places.)
Also add a correct "model" method to MultipathDevice - we want to
display the model for the underlying disk device, not "linux device
mapper device" or whatnot.
---
storage/devices.py | 52 ++++++++++++++++++++++++++++++++++++++----------
storage/devicetree.py | 8 +++++-
2 files changed, 47 insertions(+), 13 deletions(-)
Arguments:
@@ -447,6 +447,10 @@ class StorageDevice(Device):
sysfsPath -- sysfs device path
format -- a DeviceFormat instance
parents -- a list of required Device instances
+ serial -- the ID_SERIAL_SHORT for this device
+ vendor -- the manufacturer of this Device
+ model -- manufacturer's device model string
+ bus -- the interconnect this device uses
"""
# allow specification of individual parents
@@ -462,8 +466,9 @@ class StorageDevice(Device):
self.major = numeric_type(major)
self.minor = numeric_type(minor)
self.sysfsPath = sysfsPath
- self.serial = serial
- self.vendor = vendor
+ self._serial = serial
+ self._vendor = vendor
+ self._model = model
self.bus = bus
self.protected = False
@@ -737,6 +742,19 @@ class StorageDevice(Device):
def partitioned(self):
return self.format.type == "disklabel" and self.partitionable
@@ -765,6 +783,7 @@ class DiskDevice(StorageDevice):
removable -- whether or not this is a removable device
serial -- the ID_SERIAL_SHORT for this device
vendor -- the manufacturer of this Device
+ model -- manufacturer's device model string
bus -- the interconnect this device uses
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
01-20-2010, 08:53 PM
Chris Lumens
Make all StorageDevice-s support .vendor and .model
> Not everything has one, but this makes them all at least show "None"
> instead of having to do the hasattr dance. Also, it now normally gets
> the info from udev rather than using parted's concatenated version
> (which fixes some minor UI problems as well as making it available at
> more places.)
>
> Also add a correct "model" method to MultipathDevice - we want to
> display the model for the underlying disk device, not "linux device
> mapper device" or whatnot.
Ship it.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list