From b0fdc65e9199309b151b9190ddff85a656644a49 Mon Sep 17 00:00:00 2001 From: Michael Ferrari Date: Wed, 15 May 2024 10:02:18 +0200 Subject: [PATCH] Prefer `config.image` over `config.image_id` When using `mkosi.images` it makes more sense to use the `image` name, as that is what identifies the different images. --- mkosi/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkosi/config.py b/mkosi/config.py index 100d006ca..4bfb468e7 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -689,7 +689,7 @@ def config_default_compression(namespace: argparse.Namespace) -> Compression: def config_default_output(namespace: argparse.Namespace) -> str: - output = namespace.image_id or namespace.image or "image" + output = namespace.image or namespace.image_id or "image" if namespace.image_version: output += f"_{namespace.image_version}" @@ -1523,7 +1523,7 @@ class Config: image: Optional[str] def name(self) -> str: - return self.image_id or self.image or "default" + return self.image or self.image_id or "default" def machine_or_name(self) -> str: return self.machine or self.name()