Move a few variables around

This should prevent a couple of crashes
due to undeclared variables.
This commit is contained in:
jvoisin
2020-04-27 12:03:54 +02:00
parent dc46ad16ae
commit 487878819e
3 changed files with 4 additions and 4 deletions

View File

@@ -101,8 +101,8 @@ DEFAULT_MAIL_SERVER = "mail.example.org"
DEFAULT_PASSWORD = "admin123"
DEFAULT_PORT = 8083
env_CALIBRE_PORT = os.environ.get("CALIBRE_PORT", DEFAULT_PORT)
try:
env_CALIBRE_PORT = os.environ.get("CALIBRE_PORT", DEFAULT_PORT)
DEFAULT_PORT = int(env_CALIBRE_PORT)
except ValueError:
print('Environment variable CALIBRE_PORT has invalid value (%s), faling back to default (8083)' % env_CALIBRE_PORT)