From: Daan De Meyer Date: Mon, 18 Mar 2024 21:28:08 +0000 (+0100) Subject: Don't load configuration for verbs that don't need it X-Git-Tag: v23~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57ca06d5e4475ecfcf8545af1fa9fd4a047bb6ed;p=thirdparty%2Fmkosi.git Don't load configuration for verbs that don't need it --- diff --git a/mkosi/config.py b/mkosi/config.py index bc711b3c6..c80d507d3 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -101,6 +101,9 @@ class Verb(StrEnum): def needs_credentials(self) -> bool: return self in (Verb.summary, Verb.qemu, Verb.boot, Verb.shell) + def needs_config(self) -> bool: + return self not in (Verb.help, Verb.genkey, Verb.documentation) + class ConfigFeature(StrEnum): auto = enum.auto() @@ -3303,6 +3306,9 @@ def parse_config(argv: Sequence[str] = (), *, resources: Path = Path("/")) -> tu if args.verb == Verb.help: PagerHelpAction.__call__(None, argparser, namespace) # type: ignore + if not args.verb.needs_config(): + return args, () + include = () if args.directory is not None: