curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #00813
Re: [Merge] ~gyurco/curtin:imsm into curtin:master
Thanks.
Diff comments:
> diff --git a/curtin/block/clear_holders.py b/curtin/block/clear_holders.py
> index 116ee81..ce1399e 100644
> --- a/curtin/block/clear_holders.py
> +++ b/curtin/block/clear_holders.py
> @@ -165,11 +165,17 @@ def shutdown_mdadm(device):
> """
>
> blockdev = block.sysfs_to_devpath(device)
> + query = mdadm.mdadm_query_detail(blockdev)
> +
> + if query.get('MD_CONTAINER'):
> + LOG.info('Array is in a container, skip discovering raid devices and spares for %s', device)
> + md_devs = ()
> + else:
> + LOG.info('Discovering raid devices and spares for %s', device)
> + md_devs = (
> + mdadm.md_get_devices_list(blockdev) +
> + mdadm.md_get_spares_list(blockdev))
>
> - LOG.info('Discovering raid devices and spares for %s', device)
> - md_devs = (
> - mdadm.md_get_devices_list(blockdev) +
> - mdadm.md_get_spares_list(blockdev))
> mdadm.set_sync_action(blockdev, action="idle")
> mdadm.set_sync_action(blockdev, action="frozen")
I was asking about the mdadm.set_sync_action; does that work on a container (I would think not, rather one needs to stop the sub-volumes) but maybe stopping the container also stops the sub-volumes?
>
> @@ -186,7 +192,7 @@ def shutdown_mdadm(device):
> LOG.debug('Non-fatal error writing to array device %s, '
> 'proceeding with shutdown: %s', blockdev, e)
>
> - LOG.info('Removing raid array members: %s', md_devs)
> + LOG.info('Removing raid array members: ', md_devs)
That's because you created a tuple, md_devs = (); where as the original code used parenthesis to assemble a list.
>>> md_devs = (
... [] + [])
>>> type(md_devs)
<class 'list'>
>>> print("%s" % md_devs)
[]
>>> md_devs = ()
>>> type(md_devs)
<class 'tuple'>
>>> print("%s" % md_devs)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string
> for mddev in md_devs:
> try:
> mdadm.fail_device(blockdev, mddev)
--
https://code.launchpad.net/~gyurco/curtin/+git/curtin/+merge/390307
Your team curtin developers is requested to review the proposed merge of ~gyurco/curtin:imsm into curtin:master.
References