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

Brian C. Lane bcl at redhat.com
Thu Mar 13 18:30:49 UTC 2014


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.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list