Skip to content

Commit 266d6e5

Browse files
authored
Check that all variables are defined in the config (#20)
1 parent d2b76e8 commit 266d6e5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

hunter/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def load_test_groups(config: Dict, tests: Dict[str, TestConfig]) -> Dict[str, Li
8080
def load_config_from(config_file: Path) -> Config:
8181
"""Loads config from the specified location"""
8282
try:
83-
content = expandvars(config_file.read_text())
83+
content = expandvars(config_file.read_text(), nounset=True)
8484
yaml = YAML(typ="safe")
8585
config = yaml.load(content)
8686
"""

tests/resources/sample_config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Please place this file in `~/.hunter/hunter.yaml` and provide the missing config values:
22
fallout:
33
url: https://fallout.sjc.dsinternal.org/
4-
user: ${FALLOUT_USER}
5-
token: ${FALLOUT_OAUTH_TOKEN}
4+
user: FALLOUT_USER
5+
token: FALLOUT_OAUTH_TOKEN
66

77
graphite:
88
url: http://history.sjc.dsinternal.org/
@@ -17,8 +17,8 @@ graphite:
1717

1818
grafana:
1919
url: http://history.datastax.lan:3000/
20-
user: ${GRAFANA_USER}
21-
password: ${GRAFANA_PASSWORD}
20+
user: GRAFANA_USER
21+
password: GRAFANA_PASSWORD
2222

2323
# Templates define common bits shared between test definitions
2424
templates:

0 commit comments

Comments
 (0)