diff --git a/src/autoconf/Config.py b/src/autoconf/Config.py index c9858d166..eb2074ff9 100644 --- a/src/autoconf/Config.py +++ b/src/autoconf/Config.py @@ -140,6 +140,13 @@ class Config(ConfigCaller): if err: self.__logger.error(f"Failed to update instances: {err}") + # save config to database + if "config" in changes: + err = self._db.save_config(self.__config, "autoconf", changed=False) + if err: + success = False + self.__logger.error(f"Can't save config in database: {err}, config may not work as expected") + # save custom configs to database if "custom_configs" in changes: err = self._db.save_custom_configs(custom_configs, "autoconf", changed=False) @@ -147,16 +154,9 @@ class Config(ConfigCaller): success = False self.__logger.error(f"Can't save autoconf custom configs in database: {err}, custom configs may not work as expected") - # save config to database - if "config" in changes: - err = self._db.save_config(self.__config, "autoconf") - if err: - success = False - self.__logger.error(f"Can't save config in database: {err}, config may not work as expected") - else: - # update changes in db - ret = self._db.checked_changes(changes, value=True) - if ret: - self.__logger.error(f"An error occurred when setting the changes to checked in the database : {ret}") + # update changes in db + ret = self._db.checked_changes(changes, value=True) + if ret: + self.__logger.error(f"An error occurred when setting the changes to checked in the database : {ret}") return success diff --git a/src/common/gen/save_config.py b/src/common/gen/save_config.py index b14ac0973..d5b01b746 100644 --- a/src/common/gen/save_config.py +++ b/src/common/gen/save_config.py @@ -223,7 +223,7 @@ if __name__ == "__main__": # Compute the config if not config_files: logger.info("Computing config ...") - config = Configurator(args.settings, args.core, external_plugins, pro_plugins, tmp_config, logger) + config = Configurator(args.settings, args.core, external_plugins, pro_plugins, str(Path(args.variables)), logger) config_files = config.get_config() bunkerweb_version = Path(sep, "usr", "share", "bunkerweb", "VERSION").read_text().strip()