summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-31 18:42:39 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-31 18:42:39 +0800
commit854681fcf76e6982e323628e7031c5fc0ad4f179 (patch)
tree1aa7431a78ffbe1b6bf2cb9c7644ce85eb4d8df3
parent1acfc8d8e88a77dc07fcf051fa699a19788106a9 (diff)
Only read environment variable when it exists
-rw-r--r--jimbrella/config.py6
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)