[PATCH 3/4] Improve the info provided to DeviceAction.__str__.

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

 



 - Move format property up to DeviceAction so it can be inherited
 - Use the format property in DeviceAction.__str__
 - Include device id in DeviceAction.__str__
 - Include migration target name in ActionMigrateFormat.__str__
 - Reword from, eg: "sda2 (partition)" to "partition sda2 (id 4)"
---
 storage/deviceaction.py |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/storage/deviceaction.py b/storage/deviceaction.py
index 4a06d22..0b34555 100644
--- a/storage/deviceaction.py
+++ b/storage/deviceaction.py
@@ -175,19 +175,20 @@ class DeviceAction(object):
     def isFormat(self):
         return self.obj == ACTION_OBJECT_FORMAT
 
+    @property
+    def format(self):
+        return self.device.format
+
     def __str__(self):
         s = "%s %s" % (action_strings[self.type], object_strings[self.obj])
         if self.isResize():
             s += " (%s)" % resize_strings[self.dir]
         if self.isFormat():
-            if self.device.format:
-                fmt_type = self.device.format.type
-            else:
-                fmt_type = None
-            s += " %s on" % fmt_type
+            s += " %s on" % self.format.type
         if self.isMigrate():
-            pass
-        s += " %s (%s)" % (self.device.name, self.device.type)
+            s += " to %s" % self.format.migrationTarget
+        s += " %s %s (id %d)" % (self.device.type, self.device.name,
+                                 self.device.id)
         return s
 
 class ActionCreateDevice(DeviceAction):
@@ -279,10 +280,6 @@ class ActionCreateFormat(DeviceAction):
     def cancel(self):
         self.device.format = self.origFormat
 
-    @property
-    def format(self):
-        return self.device.format
-
 
 class ActionDestroyFormat(DeviceAction):
     """ An action representing the removal of an existing filesystem.
-- 
1.6.0.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