From 297196651c1efbdf306fbe1c08db58ef08461940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Tue, 5 Dec 2023 22:32:03 +0000 Subject: [PATCH] Merge CLI configuration file with base config --- python/lvmecp/__main__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/lvmecp/__main__.py b/python/lvmecp/__main__.py index 0a67b05..2eeac5b 100644 --- a/python/lvmecp/__main__.py +++ b/python/lvmecp/__main__.py @@ -16,7 +16,7 @@ import click from click_default_group import DefaultGroup -from sdsstools import read_yaml_file +from sdsstools import Configuration from sdsstools.daemonizer import DaemonGroup, cli_coro from lvmecp import config, log @@ -50,7 +50,7 @@ def lvmecp(ctx, verbose, config_file: str | None): @lvmecp.group(cls=DaemonGroup, prog="ecp-actor", workdir=os.getcwd()) @click.option( - "--with-simulator/", + "--with-simulator", is_flag=True, help="Runs the actor aginst the simulator.", ) @@ -59,10 +59,10 @@ def lvmecp(ctx, verbose, config_file: str | None): async def actor(ctx, with_simulator: bool = False): """Runs the actor.""" - config_file = ctx.obj["config_file"] - if config_file: - ecp_config = read_yaml_file(config_file) - log.info(f"Using config file {config_file}") + cli_config_file = ctx.obj["config_file"] + if cli_config_file: + ecp_config = Configuration(cli_config_file, base_config=config) + log.info(f"Using config file {cli_config_file}") else: ecp_config = deepcopy(config) log.info("Using internal configuration.")