]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Prefer `config.image` over `config.image_id`
authorMichael Ferrari <nekkodroid404@gmail.com>
Wed, 15 May 2024 08:02:18 +0000 (10:02 +0200)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 15 May 2024 09:29:12 +0000 (11:29 +0200)
When using `mkosi.images` it makes more sense to use the `image` name,
as that is what identifies the different images.

mkosi/config.py

index 100d006ca8c516504c0eade1156cc9714f2e4a26..4bfb468e732695a448dea354f529c1d7151df214 100644 (file)
@@ -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()