[PATCH 12/13] Decide on supported RAID levels in a better way

Anne Mulhern amulhern at redhat.com
Fri Mar 14 11:20:27 UTC 2014





----- Original Message -----
> From: "Brian C. Lane" <bcl at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Thursday, March 13, 2014 5:12:22 PM
> Subject: Re: [PATCH 12/13] Decide on supported RAID levels in a better way
> 
> On Thu, Mar 13, 2014 at 08:57:52PM +0100, Vratislav Podzimek wrote:
> > On Thu, 2014-03-13 at 11:30 -0700, Brian C. Lane wrote:
> > > On Mon, Mar 10, 2014 at 02:22:18PM +0100, Vratislav Podzimek wrote:
> > > > Supported RAID levels shouldn't be defined in a cryptic way in a .glade
> > > > file and
> > > > processed in at the same cryptic way.
> > > > 
> > > > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > > > ---
> > > >  pyanaconda/storage_utils.py                        | 19 ++++++++++++
> > > >  pyanaconda/ui/gui/spokes/custom.glade              | 36
> > > >  ----------------------
> > > >  pyanaconda/ui/gui/spokes/custom.py                 | 10 +++---
> > > >  .../ui/gui/spokes/lib/custom_storage_helpers.glade | 36
> > > >  ----------------------
> > > >  .../ui/gui/spokes/lib/custom_storage_helpers.py    | 11 ++++---
> > > >  5 files changed, 30 insertions(+), 82 deletions(-)
> > > > 
> > > > diff --git a/pyanaconda/storage_utils.py b/pyanaconda/storage_utils.py
> > > > index b971111..504f72d 100644
> > > > --- a/pyanaconda/storage_utils.py
> > > > +++ b/pyanaconda/storage_utils.py
> > > > @@ -25,6 +25,20 @@ import locale
> > > >  
> > > >  from blivet.size import Size
> > > >  from blivet.errors import SizeParamsError
> > > > +from blivet.devicefactory import DEVICE_TYPE_LVM
> > > > +from blivet.devicefactory import DEVICE_TYPE_BTRFS
> > > > +from blivet.devicefactory import DEVICE_TYPE_MD
> > > > +
> > > > +# should this and the get_supported_raid_levels go to
> > > > blivet.devicefactory???
> > > > +SUPPORTED_RAID_LEVELS = {DEVICE_TYPE_LVM: {"none", "raid0", "raid1"},
> > > > +                         DEVICE_TYPE_MD: {"raid0", "raid1", "raid4",
> > > > "raid5",
> > > > +                                          "raid6", "raid10"},
> > > > +                         DEVICE_TYPE_BTRFS: {"none", "raid0", "raid1",
> > > > +                                             "raid10"},
> > > > +                         # no device type for LVM VG
> > > > +                         # VG: {"none", "raid0", "raid1", "raid4",
> > > > +                         #      "raid5", "raid6", "raid10"},
> > > > +                        }
> > > 
> > > I agree, this belongs in blivet. Preferrably in some way that doesn't
> > > require manual maintenance of it.
> > True, but I'd still like to apply this change now as the first step
> > toward bright future. :)
> 
> yeah, it is a step in the right direction, that's for sure.
> 
> --
> Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA
> (PST8PDT)
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

There is already a facility in blivet:master for maintaining lists of RaidLevels.
See blivet/devicelibs/raid.RAIDLevels.

It would be preferable to use this. See an example of its use in blivet.devicelibs.mdraid.py.

Note that it stores RAID objects, not strings, so it is necessary to convert one to the other,
somewhere, or encourage anaconda i nthe use of RAID objects.

Also, RAID level none is currently not a known RAID level.

Let me know if you want to take the next step, if not, I'll pick it up fairly soon, since I see the code
has already been committed.

- mulhern







More information about the anaconda-patches mailing list