From patchwork Sat Dec 18 12:57:45 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: 4922 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 4JGQqz0BXTz3wtM for ; Sat, 18 Dec 2021 12:57:50 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4JGQqy0QSnz3NV; Sat, 18 Dec 2021 12:57:50 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4JGQqx3fRbz2y2L; Sat, 18 Dec 2021 12:57:49 +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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4JGQqw1kY2z2xxK for ; Sat, 18 Dec 2021 12:57:48 +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)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4JGQqv2RMsz199 for ; Sat, 18 Dec 2021 12:57:47 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1639832267; 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=5LaVdNqqPCSZJJ2Orp+yWhPu29mTmfT/2TYYnv87gwU=; b=pwGJCzCMdRK00e9fC4SDCTVW2/rwiKRWYMc9rI8fApOqp3BPbrLvhoqgEACBk2i8GAeIgg tGkr+/J2ggCsGIDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1639832267; 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=5LaVdNqqPCSZJJ2Orp+yWhPu29mTmfT/2TYYnv87gwU=; b=Vu5oaeY1PkkDA1w1ptCpamQKlWR8PmWsiGtZlEXriHOCDLDsEjs+SDNf/7OXtyCbGsASCZ XOJkiQmhBO+ly3GkpjxTXF9Qb2EO2MZa9NeFbMIeosmlWV4BAoexcD89geWNalR4+CZBCZ OrZq+32vaRoBhQntVuchh9Iv0k2v5JutrubtF7UPJbGUUvkt1zIThA4pA/NwYQc1TpODK0 KhgnzDyCtd9E4Hr+1fdT1WHi8QyHK2sk+zsXTInYMXxJrKyVckKyi+SCPG1FEyFHjl+LJk 8SWQgf+Jb2+3cZnNvwcRcp0Cuz0M2OYJS7bFQyOXNvN3Rcy/MVDr6nsj41ryZw== To: "IPFire: Location" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] location-importer.in: Do not make things more complicated than they are Message-ID: Date: Sat, 18 Dec 2021 13:57:45 +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" Suggested-by: Michael Tremer Signed-off-by: Peter Müller Reviewed-by: Michael Tremer --- 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 118b0de..f39a42b 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -687,7 +687,7 @@ class CLI(object): start_address = ipaddress.ip_network(start_address, strict=False) except ValueError: start_address = start_address.split("/") - ldigits = len(start_address[0].split(".")) + ldigits = start_address[0].count(".") # How many octets do we need to add? # (LACNIC does not seem to have a /8 or greater assigned, so the following should suffice.)