From: Daan De Meyer Date: Wed, 4 Jun 2025 14:18:37 +0000 (+0200) Subject: Check that keys are both in context.cli and history X-Git-Tag: v26~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a2226017917fb054f3afdcc0ca6ea62b281896b;p=thirdparty%2Fmkosi.git Check that keys are both in context.cli and history Otherwise we'll get a KeyError trying to access a key in the history dict that isn't there. Fixes #3747. --- diff --git a/mkosi/config.py b/mkosi/config.py index ab893f86b..c966260a8 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -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" )