From patchwork Sun Dec 12 09:05:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 4918 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4JBdyS4pFYz3wt3 for ; Sun, 12 Dec 2021 09:05:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4JBdyR6WMtzBw; Sun, 12 Dec 2021 09:05:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4JBdyR2jcYz2yRd; Sun, 12 Dec 2021 09:05:19 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4JBdyQ6jhlz2yYx for ; Sun, 12 Dec 2021 09:05:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4JBdyP6w1jzBw for ; Sun, 12 Dec 2021 09:05:17 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1639299918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RiAxfDkBPq6a41G4JE0F6HiEYJjah3tBFtpPnXi1fiE=; b=UJHtgxgY6+d0fOW8jzKlUC3DhY56yhNbVzu1JUZ1Jpwe1Cu+TiP4g0g0f5hh3ghQFA0Ajs Iijn1dZm5ae3WGDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1639299918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RiAxfDkBPq6a41G4JE0F6HiEYJjah3tBFtpPnXi1fiE=; b=rVNMHrndTZ1AQ8E3iLO/yP3xch0kYsf3NP1IaRvM7/XeS9aRtthJLfDF3XEdBQQTEHgMnF x4mIwERt6b7Q7JkWJeGRt1R1+o07AF2wEZgm7GiRWLdgNbXliW482b8mlisW1RgEBSf2bb QzOAGCWaq2DpHj025jKc+hVPn/BIWncyXmAYXfOMmIfE4umOseqAPZdYu9PIIp4s576H4q UylF/DSLHJcsIDQM5LUHxlLudyKq/AdXHg0BWEYeClmpBc3883P39XUTvhvzhOyqIRm9oM +i46zLVXDikpCwJ3VlqGEx32QxT35ZUcGdt6sApSIW37zLcQZ8/bV+qYgWo1Gg== To: "IPFire: Location" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] location-importer: Improve regex for catching historic/orphaned data Message-ID: Date: Sun, 12 Dec 2021 10:05:15 +0100 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: location-bounces@lists.ipfire.org Sender: "Location" This silences a bunch of warnings due to allocations at APNIC having country code set to "ZZ", which are completely irrelevant to us. Signed-off-by: Peter Müller --- src/python/location-importer.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/location-importer.in b/src/python/location-importer.in index b791b4d..b066ac6 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -671,7 +671,7 @@ class CLI(object): # Filter any inetnum records which are only referring to IP space # not managed by that specific RIR... if key == "netname": - if re.match(r"(ERX-NETBLOCK|(AFRINIC|ARIN|LACNIC|RIPE)-CIDR-BLOCK|IANA-NETBLOCK-\d{1,3}|NON-RIPE-NCC-MANAGED-ADDRESS-BLOCK)", val.strip()): + if re.match(r"^(ERX-NETBLOCK|(AFRINIC|ARIN|LACNIC|RIPE)-CIDR-BLOCK|IANA-NETBLOCK-\d{1,3}|NON-RIPE-NCC-MANAGED-ADDRESS-BLOCK|STUB-[\d-]{3,}SLASH\d{1,2})", val.strip()): log.debug("Skipping record indicating historic/orphaned data: %s" % val.strip()) return