Re: [PATCH] Warn when ignoring BIOS RAID members (#560932)

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

 



On 02/15/2010 04:20 PM, Hans de Goede wrote:
This patch adds a warning when ignoring BIOS RAID members because no complete
set using them could be found.

This patch also introduces a much needed InstallInterfaceBase class

Nice!

didn't feel like adding the exact same code to all of cmdline.py, gui.py and
text.py .

Note that the ignoring of BIOS RAID members is checked in 2 places, as
the filter UI can be skipped under certain circumstances (kickstart). The
interface code checks for disks it has already warned about.


+import gettext
+_ = lambda x: gettext.ldgettext("anaconda", x)
+P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
+
+class InstallInterfaceBase(object):

Isn't this is going to make all install interfaces what they call the new-style class? That's good I guess, let's hope we won't observe any adversities.

+    def __init__(self):
+        self._warnedUnusedRaidMembers = []
+
+    def unusedRaidMembersWarning(self, unusedRaidMembers):
+        """Warn about unused BIOS RAID members"""
+        unusedRaidMembers = \
+            filter(lambda m: m not in self._warnedUnusedRaidMembers,
+                   unusedRaidMembers)
+        if unusedRaidMembers:
+            self._warnedUnusedRaidMembers.extend(unusedRaidMembers)
+            unusedRaidMembers.sort()
+            self.messageWindow(_("Warning"),
+                P_("Disk %s contains BIOS RAID metadata, but is not part of "
+                   "any recognized BIOS RAID sets. Ignoring disk %s." %
+                   (", ".join(unusedRaidMembers),
+                    ", ".join(unusedRaidMembers)),
+                   "Disks %s contain BIOS RAID metadata, but are not part of "
+                   "any recognized BIOS RAID sets. Ignoring disks %s." %
+                   (", ".join(unusedRaidMembers),
+                    ", ".join(unusedRaidMembers)),
+                   len(unusedRaidMembers)),
+                custom_icon="warning")

I would make all the self methods you call here (messageWindow()) a part of the interface that throw something like NotImplemented() by default.

Otherwise ack.

Ales

_______________________________________________
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