From 7eb4ea872f6ef1869bb7bbf8a452aa609710def4 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 5 Aug 2023 17:49:07 +0200 Subject: [PATCH] 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. --- mkosi/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}"] -- 2.47.3