From: Stephen Finucane Date: Fri, 21 Sep 2018 16:59:48 +0000 (+0100) Subject: settings: Don't configure logging for parsearchive X-Git-Tag: v2.2.0-rc1~272 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa266a28;p=thirdparty%2Fpatchwork.git settings: Don't configure logging for parsearchive A recent change added additional ERROR level logs to the 'parsearchive' tool. This highlighted an issue, whereby we had configured all modules in 'patchwork.management.command' to email administrators on ERROR logs. We clearly shouldn't be doing this for the 'parsearchive' command or for anything other than 'parsemail', so fix this. Along the way, we remove a now-unnecessary 'extra' argument to one of the logging calls in 'parsearchive' and resolve a pep8 issue. Signed-off-by: Stephen Finucane Fixes: 133091da ("parsearchive: Fix logging") Cc: Daniel Axtens --- diff --git a/patchwork/management/commands/parsearchive.py b/patchwork/management/commands/parsearchive.py index e8904112..37db2b0d 100644 --- a/patchwork/management/commands/parsearchive.py +++ b/patchwork/management/commands/parsearchive.py @@ -97,8 +97,7 @@ class Command(BaseCommand): logger.warning('Duplicate mail for message ID %s', exc.msgid) except (ValueError, Exception) as exc: errors += 1 - logger.warning('Invalid mail: %s', exc.message, - extra={'mail': mail.as_string()}) + logger.warning('Invalid mail: %s', exc.message) if verbosity < 3 and (i % 10) == 0: self.stdout.write('%06d/%06d\r' % (i, count), ending='') diff --git a/patchwork/parser.py b/patchwork/parser.py index eb78702f..2ba1db74 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -1153,7 +1153,6 @@ def parse_mail(mail, list_id=None): author = get_or_create_author(mail) - try: comment = Comment.objects.create( submission=submission, diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index 3eb1f0e2..1a62404f 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -185,7 +185,7 @@ LOGGING = { 'level': 'WARNING', 'propagate': False, }, - 'patchwork.management.commands': { + 'patchwork.management.commands.parsemail': { 'handlers': ['console', 'mail_admins'], 'level': 'WARNING', 'propagate': True,