mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-08-01 06:03:02 +02:00
Use values from BORG_* env variables if they are not specified in config.yaml
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user