From 266d6e5a9d1374524895a7bd3630d345b3daed3d Mon Sep 17 00:00:00 2001 From: Alex Sorokoumov <918393+Gerrrr@users.noreply.github.com> Date: Mon, 23 Sep 2024 06:03:30 -0700 Subject: [PATCH] Check that all variables are defined in the config (#20) --- hunter/config.py | 2 +- tests/resources/sample_config.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hunter/config.py b/hunter/config.py index e6638f2..d961457 100644 --- a/hunter/config.py +++ b/hunter/config.py @@ -80,7 +80,7 @@ def load_test_groups(config: Dict, tests: Dict[str, TestConfig]) -> Dict[str, Li def load_config_from(config_file: Path) -> Config: """Loads config from the specified location""" try: - content = expandvars(config_file.read_text()) + content = expandvars(config_file.read_text(), nounset=True) yaml = YAML(typ="safe") config = yaml.load(content) """ diff --git a/tests/resources/sample_config.yaml b/tests/resources/sample_config.yaml index cb41f9e..f00affa 100644 --- a/tests/resources/sample_config.yaml +++ b/tests/resources/sample_config.yaml @@ -1,8 +1,8 @@ # Please place this file in `~/.hunter/hunter.yaml` and provide the missing config values: fallout: url: https://fallout.sjc.dsinternal.org/ - user: ${FALLOUT_USER} - token: ${FALLOUT_OAUTH_TOKEN} + user: FALLOUT_USER + token: FALLOUT_OAUTH_TOKEN graphite: url: http://history.sjc.dsinternal.org/ @@ -17,8 +17,8 @@ graphite: grafana: url: http://history.datastax.lan:3000/ - user: ${GRAFANA_USER} - password: ${GRAFANA_PASSWORD} + user: GRAFANA_USER + password: GRAFANA_PASSWORD # Templates define common bits shared between test definitions templates: