[PATCH 2/4] Device class does not have a format member

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

 



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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux