fix typo in autoconf and error in save_config

This commit is contained in:
florian 2024-05-27 22:18:47 +02:00
parent c31076f70a
commit d438a20f94
No known key found for this signature in database
GPG key ID: 93EE47CC3D061500
2 changed files with 12 additions and 12 deletions

View file

@ -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

View file

@ -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()