all() returns True when passed an empty iterable, but that won't do for our purposes. Also, fwraid "containers" (the intermediate layer between the member disks and the md array that represents the fwraid array) should never be treated like disks or be considered partitionable.
(Based on commit ea4eb1153ed0470a5aaff0e8ca5adce5952ec206)
Related: rhbz#1197582 --- blivet/devices/md.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/blivet/devices/md.py b/blivet/devices/md.py index 5ac2e4f..10d79c6 100644 --- a/blivet/devices/md.py +++ b/blivet/devices/md.py @@ -595,12 +595,14 @@ class MDRaidArrayDevice(ContainerDevice): @property def partitionable(self): return (self.type == "mdbiosraidarray" or - (self.exists and all(p.partitionable for p in self.parents))) + (self.exists and self.parents and + all(p.partitionable for p in self.parents)))
@property def isDisk(self): return (self.type == "mdbiosraidarray" or - (self.exists and all(p.isDisk for p in self.parents))) + (self.exists and self.parents and + all(p.isDisk for p in self.parents)))
def dracutSetupArgs(self): return set(["rd.md.uuid=%s" % self.mdadmFormatUUID])
Related: rhbz#1197582 --- blivet/devices/md.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/blivet/devices/md.py b/blivet/devices/md.py index 10d79c6..aa8eb18 100644 --- a/blivet/devices/md.py +++ b/blivet/devices/md.py @@ -594,15 +594,17 @@ class MDRaidArrayDevice(ContainerDevice):
@property def partitionable(self): - return (self.type == "mdbiosraidarray" or - (self.exists and self.parents and - all(p.partitionable for p in self.parents))) + return (self.type != "mdcontainer" and + (self.type == "mdbiosraidarray" or + (self.exists and self.parents and + all(p.partitionable for p in self.parents))))
@property def isDisk(self): - return (self.type == "mdbiosraidarray" or - (self.exists and self.parents and - all(p.isDisk for p in self.parents))) + return (self.type != "mdcontainer" and + (self.type == "mdbiosraidarray" or + (self.exists and self.parents and + all(p.isDisk for p in self.parents))))
def dracutSetupArgs(self): return set(["rd.md.uuid=%s" % self.mdadmFormatUUID])
On Mon, 2015-09-14 at 10:53 -0400, David Lehman wrote:
all() returns True when passed an empty iterable, but that won't do for our purposes. Also, fwraid "containers" (the intermediate layer between the member disks and the md array that represents the fwraid array) should never be treated like disks or be considered partitionable.
Seems good to me
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
anaconda-patches@lists.fedorahosted.org