Skip to content

Commit

Permalink
Merge CLI configuration file with base config
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Dec 5, 2023
1 parent d55ad27 commit 2971966
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/lvmecp/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import click
from click_default_group import DefaultGroup

from sdsstools import read_yaml_file
from sdsstools import Configuration

Check warning on line 19 in python/lvmecp/__main__.py

View check run for this annotation

Codecov / codecov/patch

python/lvmecp/__main__.py#L19

Added line #L19 was not covered by tests
from sdsstools.daemonizer import DaemonGroup, cli_coro

from lvmecp import config, log
Expand Down Expand Up @@ -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.",
)
Expand All @@ -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"]

Check warning on line 62 in python/lvmecp/__main__.py

View check run for this annotation

Codecov / codecov/patch

python/lvmecp/__main__.py#L62

Added line #L62 was not covered by tests
if cli_config_file:
ecp_config = Configuration(cli_config_file, base_config=config)
log.info(f"Using config file {cli_config_file}")

Check warning on line 65 in python/lvmecp/__main__.py

View check run for this annotation

Codecov / codecov/patch

python/lvmecp/__main__.py#L64-L65

Added lines #L64 - L65 were not covered by tests
else:
ecp_config = deepcopy(config)
log.info("Using internal configuration.")
Expand Down

0 comments on commit 2971966

Please sign in to comment.