diff options
author | David Lehman <dlehman@redhat.com> | 2009-04-01 12:07:41 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-04-02 22:09:03 -0500 |
commit | d073744b0d7e0289e605a520482e1cd266203907 (patch) | |
tree | b9e7aff4f171ba7c9936b6ec83ac55a6921be5f4 | |
parent | 96e3c9805355372e4bbb30d8ca3791cc252b758e (diff) | |
download | anaconda-d073744b0d7e0289e605a520482e1cd266203907.tar.gz anaconda-d073744b0d7e0289e605a520482e1cd266203907.tar.xz anaconda-d073744b0d7e0289e605a520482e1cd266203907.zip |
Make the disk model an attribute of DiskDevice.
-rw-r--r-- | iw/autopart_type.py | 2 | ||||
-rw-r--r-- | iw/partition_ui_helpers_gui.py | 3 | ||||
-rw-r--r-- | storage/devices.py | 4 | ||||
-rw-r--r-- | textw/partition_text.py | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/iw/autopart_type.py b/iw/autopart_type.py index 18b5ccaf5..1b355738b 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -413,7 +413,7 @@ class PartitionTypeWindow(InstallWindow): for disk in self.storage.disks: if disk.name not in self.anaconda.id.bootloader.drivelist: continue - dispstr = "%s %8.0f MB %s" %(disk.name, disk.size, disk.partedDisk.device.model) + dispstr = "%s %8.0f MB %s" %(disk.name, disk.size, disk.model) i = bootstore.append(None) bootstore[i] = (dispstr, disk.name) if disk.name == defaultBoot: diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py index 2e00dc33a..2722d7d8a 100644 --- a/iw/partition_ui_helpers_gui.py +++ b/iw/partition_ui_helpers_gui.py @@ -154,10 +154,9 @@ def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True, selected = 1 sizestr = "%8.0f MB" % disk.size - # TODO: abstract disk model so we don't have to reach into parted.Disk drivelist.append_row((disk.name, sizestr, - disk.partedDisk.device.model), + disk.model), selected) if len(disks) < 2: diff --git a/storage/devices.py b/storage/devices.py index da9aacc85..11f453487 100644 --- a/storage/devices.py +++ b/storage/devices.py @@ -713,6 +713,10 @@ class DiskDevice(StorageDevice): return self.partedDevice is not None @property + def model(self): + return getattr(self.partedDevice, "model", None) + + @property def size(self): """ The disk's size in MB """ if not self.mediaPresent: diff --git a/textw/partition_text.py b/textw/partition_text.py index 472a5cea3..8b71754e6 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -95,7 +95,7 @@ class PartitionTypeWindow: cleardrives = anaconda.id.storage.clearPartDisks for disk in disks: - model = disk.partedDisk.device.model + model = disk.model if not cleardrives or len(cleardrives) < 1: selected = 1 |