cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #02352
Re: [Merge] ~smoser/cloud-init:bug/1692093-sometimes-need-settle into cloud-init:master
Other than trying to understand the comment about dropping blkdev command (which I think still is present at line 13) it looks good.
Diff comments:
> diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py
> index e1505b3..7aacae4 100644
> --- a/cloudinit/config/cc_disk_setup.py
> +++ b/cloudinit/config/cc_disk_setup.py
> @@ -737,6 +737,21 @@ def exec_mkpart(table_type, device, layout):
> return get_dyn_func("exec_mkpart_%s", table_type, device, layout)
>
>
> +def udevadm_settle():
> + util.subp(['udevadm', 'settle'])
> +
> +
> +def assert_and_settle_device(device):
> + """Assert that device exists and settle so it is fully recognized."""
> + if not os.path.exists(device):
> + udevadm_settle()
> + if not os.path.exists(device):
> + raise RuntimeError("Device %s did not exist and was not created "
> + "with a udevamd settle." % device)
> +
> + udevadm_settle()
Yes, that makes sense.
> +
> +
> def mkpart(device, definition):
> """
> Creates the partition table.
--
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/324639
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:bug/1692093-sometimes-need-settle into cloud-init:master.
References