From patchwork Thu Jan 4 15:43:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 855667 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zCBtB062Zz9s7n for ; Fri, 5 Jan 2018 02:44:02 +1100 (AEDT) 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="I8KXef27"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zCBt95nXWzF0QJ for ; Fri, 5 Jan 2018 02:44:01 +1100 (AEDT) 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="I8KXef27"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=23.83.222.35; helo=chocolate.ash.relay.mailchannels.net; envelope-from=stephen@that.guru; receiver=) 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="I8KXef27"; dkim-atps=neutral Received: from chocolate.ash.relay.mailchannels.net (chocolate.ash.relay.mailchannels.net [23.83.222.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zCBt35v8vzDqTm for ; Fri, 5 Jan 2018 02:43:54 +1100 (AEDT) X-Sender-Id: mxroute|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 32F7C72123E for ; Thu, 4 Jan 2018 15:43:49 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.16.28]) (Authenticated sender: mxroute) by relay.mailchannels.net (Postfix) with ESMTPA id C0DEE720958 for ; Thu, 4 Jan 2018 15:43:48 +0000 (UTC) X-Sender-Id: mxroute|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.55.109]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.11.3); Thu, 04 Jan 2018 15:43:49 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: mxroute|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: mxroute X-Spot-Juvenile: 6f7ab51d79cad965_1515080628972_2158793012 X-MC-Loop-Signature: 1515080628972:1582489594 X-MC-Ingress-Time: 1515080628971 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=mfcql5py2pRfQJRIC6azMYKlGMw4owaXQzFiRBC6Ta4=; b=I8KXef2792syTw6eZnoDmfVwN0 skTwzPZymtHkZZ/asC9oz4vuZBFZfW247SU9dPkn1HNs+EYTfLbKUexz7z8D6SB2hkiLxVQtCWL0R OsHlKBEQqYQSOooaFTfH/H5ABDLL6DRl0/saUG7QoMz+7i+S7r7W+1hLVMCK+nOw8mb3Ur+JSJpAw Mo3YSZJ9LFVlVTcr/w/BzJG/zT95D5ZvN9bMbMnmRnxol8LpM8L70em+1LWPJvJlr+nkd3gzerVjc Vg0oM6APi37ahC0X59xJmcllaSEckV9RX3M3LquqA8NlDXj1Bo0NvwIxFbodQm7hKu8NS4soT+Yfk Zx8T32sA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v2] parser: Log when invalid project list-id passed Date: Thu, 4 Jan 2018 15:43:41 +0000 Message-Id: <20180104154341.21555-1-stephen@that.guru> X-Mailer: git-send-email 2.14.3 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.24 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" I thought there was a bug. Turns out I was just using the wrong list-id. Make this clearer. Signed-off-by: Stephen Finucane --- v2: - Don't use 'error' level logging (aconole) - Add a second log for fetching list-id from mail headers --- patchwork/parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/patchwork/parser.py b/patchwork/parser.py index 1568bc44..05249df0 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -156,7 +156,7 @@ def find_project_by_id(list_id): try: project = Project.objects.get(listid=list_id) except Project.DoesNotExist: - pass + logger.debug("'%s' if not a valid project list-id", list_id) return project @@ -185,6 +185,9 @@ def find_project_by_header(mail): if project: break + if not project: + logger.debug("Could not find a list-id in mail headers", list_id) + return project