commit 34e912bbb3b9815469f1d2afe30c34bb6d588a4b Author: Cecylia Bocovich cohosh@torproject.org Date: Mon Jan 20 17:27:03 2020 -0500
Fix edge case where config file never declared
This commit fixes an edge case in which the config filename is never declared if the config is set but the file does not exist on disk. --- gettor/utils/settings.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/gettor/utils/settings.py b/gettor/utils/settings.py index 67c31ec..4583b6a 100644 --- a/gettor/utils/settings.py +++ b/gettor/utils/settings.py @@ -28,9 +28,8 @@ class Settings(object):
# If a readable config file was provided, use that instead - if config: - if os.path.isfile(config): - self.filename = config + if config and os.path.isfile(config): + self.filename = config else: # Default config default_config = "/home/gettor/gettor/gettor.conf.json"
tor-commits@lists.torproject.org