From: Daan De Meyer Date: Sat, 5 Aug 2023 15:49:07 +0000 (+0200) Subject: Machine name fixes X-Git-Tag: v15~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7eb4ea872f6ef1869bb7bbf8a452aa609710def4;p=thirdparty%2Fmkosi.git Machine name fixes - Prefer the image id or preset name over the output name - Make sure the machine name doesn't contain underscores as those are not allowed. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 028d90395..60c5e7ab4 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1766,7 +1766,8 @@ def run_shell(args: MkosiArgs, config: MkosiConfig) -> None: "--console=autopipe", ] - cmdline += ["--machine", config.output] + # Underscores are not allowed in machine names so replace them with hyphens. + cmdline += ["--machine", (config.image_id or config.preset or config.output).replace("_", "-")] for k, v in config.credentials.items(): cmdline += [f"--set-credential={k}:{v}"]