← Back to team overview

curtin-dev team mailing list archive

Re: [Merge] ~mwhudson/curtin:mdadm-check-container into curtin:master

 

One minor suggestion below.

Diff comments:

> diff --git a/curtin/block/mdadm.py b/curtin/block/mdadm.py
> index a6ac970..a5dfc9f 100644
> --- a/curtin/block/mdadm.py
> +++ b/curtin/block/mdadm.py
> @@ -770,24 +740,24 @@ def md_check_array_state(md_devname):
>      # check array state
>  
>      writable = md_check_array_state_rw(md_devname)
> -    degraded = md_sysfs_attr(md_devname, 'degraded')
> -    sync_action = md_sysfs_attr(md_devname, 'sync_action')
> +    # Raid 0 arrays do not have degraded or sync_action sysfs
> +    # attributes.
> +    degraded = md_sysfs_attr(md_devname, 'degraded', None)
> +    sync_action = md_sysfs_attr(md_devname, 'sync_action', None)
>  
>      if not writable:
>          raise ValueError('Array not in writable state: ' + md_devname)
> -    if degraded != "0":
> +    if degraded is not None and degraded != "0":

This is a minor style quibble I suppose, but I think the "degraded is not None" portion is redundant.

>          raise ValueError('Array in degraded state: ' + md_devname)
> -    if sync_action != "idle":
> +    if degraded is not None and sync_action != "idle":
>          raise ValueError('Array syncing, not idle state: ' + md_devname)
>  
> -    return True
> -
>  
>  def md_check_uuid(md_devname):
>      md_uuid = md_get_uuid(md_devname)
>      if not md_uuid:
>          raise ValueError('Failed to get md UUID from device: ' + md_devname)
> -    return md_check_array_uuid(md_devname, md_uuid)
> +    md_check_array_uuid(md_devname, md_uuid)
>  
>  
>  def md_check_devices(md_devname, devices):


-- 
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/402384
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:mdadm-check-container into curtin:master.


References