[blivet:master 1/3] Factor out MDRaidArrayDevice w/ type in ("mdcontainer", "mdbiosraidarray")

Anne Mulhern amulhern at redhat.com
Mon Dec 15 12:58:06 UTC 2014





----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, December 12, 2014 3:52:23 PM
> Subject: Re: [blivet:master 1/3] Factor out MDRaidArrayDevice w/ type in	("mdcontainer", "mdbiosraidarray")
> 
> On 12/12/2014 12:35 PM, mulhern wrote:
> > This patch factors out functionality associated w/ type
> > "mdcontainer" or "mdbiosraidarray" into separate subclasses.
> >
> > It is also able to revert commit c197d2d39104cdef234daecf5c44098bc345b506
> > entirely, since the refactoring into MDBiosRaidArrayDevice w/
> > formatClassName None, handles all that functionality.
> >
> > Leave some checks in MDRaidArrayDevice.__init__ to prevent using this class
> > instead of its subclass.
> >
> > I tried to make the transformation as semantics preserving as possible.
> > It is kind of nice that the only changes needed to be made to
> > devices tests were to change the names of constructors.
> 
> Just a couple of comments inline...
> 


<-- SNIP -->

> > @@ -580,11 +538,11 @@ class MDRaidArrayDevice(ContainerDevice, RaidDevice):
> >
> >       @property
> >       def partitionable(self):
> > -        return self.type == "mdbiosraidarray"
> > +        return False
> >
> >       @property
> >       def isDisk(self):
> > -        return self.type == "mdbiosraidarray"
> > +        return False
> 
> The above are both default values, so you can just remove partitionable
> and isDisk from MDRaidArrayDevice.

Done!

> 
> >
> >       def dracutSetupArgs(self):
> >           return set(["rd.md.uuid=%s" % self.mdadmFormatUUID])
> > @@ -599,3 +557,110 @@ class MDRaidArrayDevice(ContainerDevice, RaidDevice):
> >           data.members = ["raid.%d" % p.id for p in self.parents]
> >           data.preexist = self.exists
> >           data.device = self.name

<-- SNIP -->

> > +    @property
> > +    def mediaPresent(self):
> > +        # BIOS RAID sets should show as present even when teared down
> > +        return True
> > +
> > +    @property
> > +    def isDisk(self):
> > +        return True
> 
> The intended way to do this is to set the class attribute _isDisk to True.
> 

Done, and gone!

<-- SNIP -->

- mulhern


More information about the anaconda-patches mailing list