diff options
author | Hans de Goede <hdegoede@redhat.com> | 2009-09-02 11:48:42 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-09-02 19:28:51 +0200 |
commit | e9363188f2409ef61e066c1b8c78ca2c371a45a6 (patch) | |
tree | a7f401847a42d6bee2f308afb7edd6fb0dad5ae0 /storage | |
parent | e02df559bc40461919c17361d482bcb948efd3ae (diff) | |
download | anaconda-e9363188f2409ef61e066c1b8c78ca2c371a45a6.tar.gz anaconda-e9363188f2409ef61e066c1b8c78ca2c371a45a6.tar.xz anaconda-e9363188f2409ef61e066c1b8c78ca2c371a45a6.zip |
Device class does not have a format member
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 .
Diffstat (limited to 'storage')
-rw-r--r-- | storage/devices.py | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/storage/devices.py b/storage/devices.py index ce8e39948..e473ca126 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) |