diff --git a/csaxs_bec/bec_ipython_client/startup/pre_startup.py b/csaxs_bec/bec_ipython_client/startup/pre_startup.py index 4ba6343..2e69c41 100644 --- a/csaxs_bec/bec_ipython_client/startup/pre_startup.py +++ b/csaxs_bec/bec_ipython_client/startup/pre_startup.py @@ -6,7 +6,7 @@ is started. It can be used to add additional command line arguments. import os from bec_lib.service_config import ServiceConfig - +import yaml import csaxs_bec @@ -27,6 +27,11 @@ def get_config() -> ServiceConfig: deployment_path = os.path.dirname(os.path.dirname(os.path.dirname(csaxs_bec.__file__))) files = os.listdir(deployment_path) if "bec_config.yaml" in files: - return ServiceConfig(config_path=os.path.join(deployment_path, "bec_config.yaml")) + config_path = os.path.join(deployment_path, "bec_config.yaml") + with open(config_path, "r", encoding="utf-8") as f: + config = yaml.safe_load(f) + config["service_config"]["log_writer"]["base_path"] = os.path.expanduser("~/.bec") + return ServiceConfig(config=config) + else: return ServiceConfig(redis={"host": "localhost", "port": 6379})