Fixed config loading
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-04-26 00:02:51 +02:00
parent ff24b9d2e9
commit 80642aca05

View File

@ -10,8 +10,8 @@ class Config:
SYNC_TIMEOUT = os.environ.get("SYNC_TIMEOUT", None) # Wait infinity by default
ROBOT_ADDRESS = os.environ.get("ROBOT_ADDRESS")
PROGRAM_URL = os.environ["PROGRAM_URL"]
DRY_RUN = ('--dry-run' in sys.argv) or bool(os.environ.get("DRY_RUN", False))
DEBUG = ('--debug' in sys.argv) or bool(os.environ.get("DEBUG", False))
DRY_RUN = ('--dry-run' in sys.argv) or bool(os.environ.get("DRY_RUN", "").upper() in ['YES', 'TRUE', '1'])
DEBUG = ('--debug' in sys.argv) or bool(os.environ.get("DEBUG", "").upper() in ['YES', 'TRUE', '1'])
HTTP_ENABLE = ('--no-http' not in sys.argv) and \
bool(os.environ.get("HTTP_ENABLE", "").upper() not in ['NO', 'FALSE', '0'])
HTTP_PORT = int(os.environ.get("HTTP_PORT", 8080))