From 049ca9941f256dc6c83e990e8181d383b1ef1142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Tue, 8 Jan 2019 05:16:05 +0200 Subject: [PATCH] Cleanup syntax and fix typo --- CHANGELOG.md | 2 +- core/dovecot/start.py | 2 +- core/nginx/config.py | 2 +- core/postfix/start.py | 2 +- services/rspamd/start.py | 2 +- services/unbound/start.py | 2 +- webmails/rainloop/start.py | 2 +- webmails/roundcube/start.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79aefd40..e69c37f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,8 +76,8 @@ v1.6.0 - unreleased - Enhancement: Move Mailu Docker network to a fixed subnet ([#727](https://github.com/Mailu/Mailu/issues/727)) - Enhancement: Added regex validation for alias username ([#764](https://github.com/Mailu/Mailu/issues/764)) - Enhancement: Update documentation -- Enhancement: Add logging at critical places in python start.py scripts. Implement LOG_LEVEL to controll verbosity ([#588](https://github.com/Mailu/Mailu/issues/588)) - Enhancement: Include favicon package ([#801](https://github.com/Mailu/Mailu/issues/801), ([#802](https://github.com/Mailu/Mailu/issues/802)) +- Enhancement: Add logging at critical places in python start.py scripts. Implement LOG_LEVEL to control verbosity ([#588] - Upstream: Update Roundcube - Upstream: Update Rainloop - Bug: Rainloop fails with "domain not allowed" ([#93](https://github.com/Mailu/Mailu/issues/93)) diff --git a/core/dovecot/start.py b/core/dovecot/start.py index b4289b76..d9273464 100755 --- a/core/dovecot/start.py +++ b/core/dovecot/start.py @@ -12,7 +12,7 @@ import sys from tenacity import retry from podop import run_server -log.basicConfig(stream=sys.stderr, level=os.environ["LOG_LEVEL"] if "LOG_LEVEL" in os.environ else "WARNING") +log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(8) diff --git a/core/nginx/config.py b/core/nginx/config.py index 528a3247..79370508 100755 --- a/core/nginx/config.py +++ b/core/nginx/config.py @@ -7,7 +7,7 @@ import sys args = os.environ.copy() -log.basicConfig(stream=sys.stderr, level=args["LOG_LEVEL"] if "LOG_LEVEL" in args else "WARNING") +log.basicConfig(stream=sys.stderr, level=args.get("LOG_LEVEL", "WARNING")) def convert(src, dst, args): logger = log.getLogger("convert()") diff --git a/core/postfix/start.py b/core/postfix/start.py index 5a8c2968..a06b3833 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -13,7 +13,7 @@ import sys from tenacity import retry from podop import run_server -log.basicConfig(stream=sys.stderr, level=os.environ["LOG_LEVEL"] if "LOG_LEVEL" in os.environ else "WARNING") +log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(100) diff --git a/services/rspamd/start.py b/services/rspamd/start.py index 047bfeba..744d4a9c 100755 --- a/services/rspamd/start.py +++ b/services/rspamd/start.py @@ -10,7 +10,7 @@ import sys from tenacity import retry -log.basicConfig(stream=sys.stderr, level=os.environ["LOG_LEVEL"] if "LOG_LEVEL" in os.environ else "WARNING") +log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def convert(src, dst): logger = log.getLogger("convert()") diff --git a/services/unbound/start.py b/services/unbound/start.py index 43a52df1..4dd5f3be 100755 --- a/services/unbound/start.py +++ b/services/unbound/start.py @@ -5,7 +5,7 @@ import os import logging as log import sys -log.basicConfig(stream=sys.stderr, level=os.environ["LOG_LEVEL"] if "LOG_LEVEL" in os.environ else "WARNING") +log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def convert(src, dst): logger = log.getLogger("convert()") diff --git a/webmails/rainloop/start.py b/webmails/rainloop/start.py index defc5be6..e2b917bf 100755 --- a/webmails/rainloop/start.py +++ b/webmails/rainloop/start.py @@ -6,7 +6,7 @@ import shutil import logging as log import sys -log.basicConfig(stream=sys.stderr, level=os.environ["LOG_LEVEL"] if "LOG_LEVEL" in os.environ else "WARNING") +log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def convert(src, dst): logger = log.getLogger("convert()") diff --git a/webmails/roundcube/start.py b/webmails/roundcube/start.py index 8d48d3b6..4effd965 100755 --- a/webmails/roundcube/start.py +++ b/webmails/roundcube/start.py @@ -5,7 +5,7 @@ import jinja2 import logging as log import sys -log.basicConfig(stream=sys.stderr, level=os.environ["LOG_LEVEL"] if "LOG_LEVEL" in os.environ else "WARNING") +log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def convert(src, dst): logger = log.getLogger("convert()")