diff --git a/stages/org.osbuild.dnf-automatic.config b/stages/org.osbuild.dnf-automatic.config index f5a4e960..7f75ee33 100755 --- a/stages/org.osbuild.dnf-automatic.config +++ b/stages/org.osbuild.dnf-automatic.config @@ -25,10 +25,13 @@ def main(tree, options): with open(dnf_automatic_config_path, "r", encoding="utf8") as f: dnf_automatic_conf.readfp(f) except FileNotFoundError: - print(f"Error: DNF automatic configuration file '{dnf_automatic_config_path}' does not exist.") - return 1 + print(f"Warning: DNF automatic configuration file '{dnf_automatic_config_path}'" + + " does not exist, will create a new one.") for config_section, config_options in config.items(): + if not dnf_automatic_conf.has_section(config_section): + dnf_automatic_conf.add_section(config_section) + for option, value in config_options.items(): if isinstance(value, bool): value = bool_to_yes_no(value)