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

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


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

This patch also introduces a much needed InstallInterfaceBase class


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

Correct, but that is not a problem as that only impact inheritance, and
nothing is inheriting from the InstallInterface classes. And moreover
this only impacts multiple inheritance which we don't use at all.

+ 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.

Good one added (and pushed).



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