From a12a1121b6687787f97f3ecc3648d0a4812ac8f0 Mon Sep 17 00:00:00 2001 From: Ralph Heinkel Date: Mon, 15 Jun 2020 19:47:14 +0200 Subject: [PATCH] Use values from BORG_* env variables if they are not specified in config.yaml --- borgmatic/borg/environment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/borgmatic/borg/environment.py b/borgmatic/borg/environment.py index 7c166db3..edd7b9d2 100644 --- a/borgmatic/borg/environment.py +++ b/borgmatic/borg/environment.py @@ -19,7 +19,8 @@ DEFAULT_BOOL_OPTION_TO_ENVIRONMENT_VARIABLE = { def initialize(storage_config): for option_name, environment_variable_name in OPTION_TO_ENVIRONMENT_VARIABLE.items(): - value = storage_config.get(option_name) + # Options from the config.yaml file have precedence over already set env variables: + value = storage_config.get(option_name) or os.environ.get(environment_variable_name) if value: os.environ[environment_variable_name] = value else: