diff options
author | Frederick Yin <fkfd@fkfd.me> | 2021-10-31 18:42:39 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2021-10-31 18:42:39 +0800 |
commit | 854681fcf76e6982e323628e7031c5fc0ad4f179 (patch) | |
tree | 1aa7431a78ffbe1b6bf2cb9c7644ce85eb4d8df3 /jimbrella | |
parent | 1acfc8d8e88a77dc07fcf051fa699a19788106a9 (diff) |
Only read environment variable when it exists
Diffstat (limited to 'jimbrella')
-rw-r--r-- | jimbrella/config.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/jimbrella/config.py b/jimbrella/config.py index 85833d0..e59aabc 100644 --- a/jimbrella/config.py +++ b/jimbrella/config.py @@ -1,7 +1,11 @@ import os import toml -config_path = os.environ["JIMBRELLA_CONFIG"] or "/opt/jimbrella/config.toml" +config_path = ( + os.environ["JIMBRELLA_CONFIG"] + if "JIMBRELLA_CONFIG" in os.environ + else "/opt/jimbrella/config.toml" +) f = open(config_path) config = toml.load(f) |