Add a log when database is ready in UI + Small refactor of the Configurator

This commit is contained in:
Théophile Diot 2023-03-23 10:34:03 +01:00
parent 1e9a55c240
commit e91f3dc226
No known key found for this signature in database
GPG key ID: E752C80DB72BB014
2 changed files with 4 additions and 4 deletions

View file

@ -47,9 +47,7 @@ class Configurator:
else:
self.__variables = variables
self.__multisite = (
"MULTISITE" in self.__variables and self.__variables["MULTISITE"] == "yes"
)
self.__multisite = self.__variables.get("MULTISITE", "no") == "yes"
self.__servers = self.__map_servers()
def get_settings(self):

View file

@ -38,6 +38,8 @@ class Config:
sleep(3)
env = self.__db.get_config()
self.__logger.info("Database is ready")
def __env_to_dict(self, filename: str) -> dict:
"""Converts the content of an env file into a dict
@ -112,7 +114,7 @@ class Config:
servers.append(server_name)
conf["SERVER_NAME"] = " ".join(servers)
env_file = "/tmp/" + str(uuid4()) + ".env"
env_file = f"/tmp/{uuid4()}.env"
self.__dict_to_env(env_file, conf)
proc = run(
[