[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH 2/4] Device class does not have a format member
- From: Hans de Goede <hdegoede redhat com>
- To: Discussion of Development and Customization of the Red Hat Linux Installer <anaconda-devel-list redhat com>
- Cc:
- Subject: [PATCH 2/4] Device class does not have a format member
- Date: Wed, 2 Sep 2009 14:02:59 +0200
The packages property in the Device class references format.packages, but
format is not a member of Device (only of StorageDevice and derived classes).
This patch fixes this by moving the format-related bits of the packages
property into StorageDevice.packages .
---
storage/devices.py | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/storage/devices.py b/storage/devices.py
index ce8e399..e473ca1 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -350,21 +350,14 @@ class Device(object):
def packages(self):
""" List of packages required to manage devices of this type.
- This list includes the packages required by this device's
- format type as well those required by all of its parent
- devices.
+ This list includes the packages required by its parent devices.
"""
packages = self._packages
- packages.extend(self.format.packages)
for parent in self.parents:
for package in parent.packages:
if package not in packages:
packages.append(package)
- for package in parent.format.packages:
- if package not in packages:
- packages.append(package)
-
return packages
@property
@@ -456,6 +449,23 @@ class StorageDevice(Device):
self._partedDevice = None
@property
+ def packages(self):
+ """ List of packages required to manage devices of this type.
+
+ This list includes the packages required by this device's
+ format type as well those required by all of its parent
+ devices.
+ """
+ packages = super(StorageDevice, self).packages
+ packages.extend(self.format.packages)
+ for parent in self.parents:
+ for package in parent.format.packages:
+ if package not in packages:
+ packages.append(package)
+
+ return packages
+
+ @property
def partedDevice(self):
if self.exists and self.status and not self._partedDevice:
log.debug("looking up parted Device: %s" % self.path)
--
1.6.4
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]