[PATCH 4/4] Add a description attribute to MDRaidArrayDevice

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

 



This stops us from backtracing when trying to formulate the question if
we need to init the label on the array.
---
 storage/devices.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index fcefb2b..e76029b 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2415,6 +2415,22 @@ class MDRaidArrayDevice(StorageDevice):
 
         return size
 
+    @property
+    def description(self):
+        if self.level == mdraid.RAID0:
+            levelstr = "striped"
+        elif self.level == mdraid.RAID1:
+            levelstr = "mirrored"
+        else:
+            levelstr = "level: %s" % self.level
+
+        if self.type == "mdcontainer":
+            return "BIOS RAID container"
+        elif self.devices and self.devices[0].type == "mdcontainer":
+            return "BIOS RAID set (%s)" % levelstr
+        else:
+            return "MDRAID set (%s)" % levelstr
+
     def __str__(self):
         s = StorageDevice.__str__(self)
         s += ("  level = %(level)s  bitmap = %(bitmap)s  spares = %(spares)s\n"
-- 
1.6.5.2

_______________________________________________
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