]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Check that keys are both in context.cli and history
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 4 Jun 2025 14:18:37 +0000 (16:18 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 5 Jun 2025 12:38:16 +0000 (14:38 +0200)
Otherwise we'll get a KeyError trying to access a key in the history
dict that isn't there.

Fixes #3747.

mkosi/config.py

index ab893f86b032c950cf100db2818a6ef34aca7634..c966260a86b129b11c11be0f7ea317fb2e8dbb81 100644 (file)
@@ -5134,7 +5134,7 @@ def parse_config(
                 history.pop(s.dest, None)
                 continue
 
-            if s.dest in context.cli and context.cli[s.dest] != history[s.dest]:
+            if s.dest in context.cli and s.dest in history and context.cli[s.dest] != history[s.dest]:
                 logging.warning(
                     f"Ignoring {s.long} from the CLI. Run with -f to rebuild the image with this setting"
                 )