From: Daan De Meyer Date: Mon, 6 May 2024 14:12:04 +0000 (+0200) Subject: Allow "enabled" and "disabled" for features X-Git-Tag: v23.1~71^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbba7809c211916d07a4905e652dbcb4c869b08c;p=thirdparty%2Fmkosi.git Allow "enabled" and "disabled" for features --- diff --git a/mkosi/config.py b/mkosi/config.py index cb15343da..759a54dc4 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -602,10 +602,10 @@ def config_parse_boolean(value: Optional[str], old: Optional[bool]) -> Optional[ def parse_feature(value: str) -> ConfigFeature: - if value == ConfigFeature.auto.name: - return ConfigFeature.auto - - return ConfigFeature.enabled if parse_boolean(value) else ConfigFeature.disabled + try: + return ConfigFeature(value) + except ValueError: + return ConfigFeature.enabled if parse_boolean(value) else ConfigFeature.disabled def config_parse_feature(value: Optional[str], old: Optional[ConfigFeature]) -> Optional[ConfigFeature]: