[PATCH 4/6] Move out the parts of Device.__str__ that are StorageDevice specific.

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

 



---
 pyanaconda/storage/devices.py |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 0ac9aa4..d3c3bda 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -262,14 +262,7 @@ class Device(object):
         return s
 
     def __str__(self):
-        exist = "existing"
-        if not self.exists:
-            exist = "non-existent"
-        s = "%s %dMB %s %s (%d)" % (exist, self.size, self.type, self.name,
-                                    self.id)
-        if self.format.type:
-            s += " with %s" % self.format
-
+        s = "%s %s (%d)" % (self.type, self.name, self.id)
         return s
 
     @property
@@ -489,6 +482,16 @@ class StorageDevice(Device):
 
         self._partedDevice = None
 
+    def __str__(self):
+        exist = "existing"
+        if not self.exists:
+            exist = "non-existent"
+        s = "%s %dMB %s" % (exist, self.size, super(StorageDevice, self).__str__())
+        if self.format.type:
+            s += " with %s" % self.format
+
+        return s
+
     @property
     def packages(self):
         """ List of packages required to manage devices of this type.
-- 
1.7.6

_______________________________________________
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