Skip to content

Commit 32df4af

Browse files
committed
Pin the Fire DB to different pattern
1 parent 9b8ec8b commit 32df4af

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

src/dea_burn_severity/configuration.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
)
3232

3333
REQUIRED_DB_ENV_VARS: dict[str, str] = {
34-
"db_host": "DB_HOSTNAME",
35-
"db_name": "DB_NAME",
36-
"db_password": "DB_PASSWORD",
37-
"db_user": "DB_USER",
34+
"db_host": "FIRE_DB_HOSTNAME",
35+
"db_name": "FIRE_DB_NAME",
36+
"db_password": "FIRE_DB_PASSWORD",
37+
"db_user": "FIRE_DB_USERNAME",
3838
"db_port": "DB_PORT",
3939
}
4040

@@ -223,21 +223,14 @@ def build_runtime_config(
223223
merged[key] = value
224224

225225
for config_key, env_var in REQUIRED_DB_ENV_VARS.items():
226-
if config_key in merged and merged[config_key]:
227-
continue
228-
env_value = os.environ.get(env_var)
229-
if env_value is None:
230-
raise RuntimeError(
231-
f"Environment variable '{env_var}' must be set to supply '{config_key}'."
232-
)
233-
merged[config_key] = env_value
226+
merged[config_key] = os.environ.get(env_var, "")
234227

235228
return RuntimeConfig.from_dict(merged)
236229

237230

238231
def get_default_runtime_config() -> RuntimeConfig:
239232
"""
240-
Lazily build the default runtime configuration (requires DB env vars).
233+
Lazily build the default runtime configuration using DB values from env vars.
241234
"""
242235
global DEFAULT_RUNTIME_CONFIG
243236
if DEFAULT_RUNTIME_CONFIG is None:

0 commit comments

Comments
 (0)