From 5f2c48a118e670b232817b4fa674e90d296a2d52 Mon Sep 17 00:00:00 2001 From: Alex Sorokoumov Date: Wed, 31 Aug 2022 15:39:48 +0200 Subject: [PATCH] Check that all variables are defined in the config --- 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: