From patchwork Fri Sep 21 17:26:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 973353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42H0sy1vWMz9sCS for ; Sat, 22 Sep 2018 03:27:50 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="M8o8TnI3"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42H0sx6qs7zF3Qr for ; Sat, 22 Sep 2018 03:27:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="M8o8TnI3"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=185.234.75.7; helo=relay-direct7.mxroute.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="M8o8TnI3"; dkim-atps=neutral Received: from relay-direct7.mxroute.com (relay-direct7.mxroute.com [185.234.75.7]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42H0ss3ZMSzF3QY for ; Sat, 22 Sep 2018 03:27:45 +1000 (AEST) Received: from filter002.mxroute.com (unknown [185.133.192.179]) by relay-direct7.mxroute.com (Postfix) with ESMTP id ABD263F359; Fri, 21 Sep 2018 17:27:11 +0000 (UTC) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter002.mxroute.com (Postfix) with ESMTPS id 8B5363F0D7; Fri, 21 Sep 2018 17:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NYXlT5bR9ObQzvEnAu+i5xDPVdvKhb+44/L8vJM9xWA=; b=M8o8TnI31k57knbWT6wKxh5Z03 QsNf4/c54hqE7798mDVE3mGz9ikm5JkFHGA2WEUekiWQsMdXqEufgm5EQ6AM7uZQ0BdCtIZwuds5X RSYWNl6JhFkVXj8CKW6npeVQ0GtYpoiOeR8HbkpBaES2Rh2ful34Gqq4JZK6i45i48a6MYRRrKDIm V9TaifN3KUrnoUWZzJy44i0eAQ1+gkGkuMp11l+8BQs6X5Rx1a+l5JX288n0bxF2T/4MBviqNWdtW jKRk4gj+CstuR6lj73oKQJxu/6rl7Yz9x00quvMcthxihhjkFgr1OOilfF9aARHlCcXMJ59EuQv1o bUB+zv0A==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH] settings: Don't configure logging for parsearchive Date: Fri, 21 Sep 2018 18:26:50 +0100 Message-Id: <20180921172650.15703-1-stephen@that.guru> X-Mailer: git-send-email 2.17.1 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" 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 --- patchwork/management/commands/parsearchive.py | 3 +-- patchwork/parser.py | 1 - patchwork/settings/base.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) 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,