public inbox for location@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] location-importer.in: Do not make things more complicated than they are
@ 2021-12-18 12:57 Peter Müller
  2021-12-20 16:54 ` Michael Tremer
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Müller @ 2021-12-18 12:57 UTC (permalink / raw)
  To: location

[-- Attachment #1: Type: text/plain, Size: 851 bytes --]

Suggested-by: Michael Tremer <michael.tremer(a)ipfire.org>
Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
---
 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.)
-- 
2.26.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] location-importer.in: Do not make things more complicated than they are
  2021-12-18 12:57 [PATCH] location-importer.in: Do not make things more complicated than they are Peter Müller
@ 2021-12-20 16:54 ` Michael Tremer
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tremer @ 2021-12-20 16:54 UTC (permalink / raw)
  To: location

[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]

Reviewed-by: Michael Tremer <michael.tremer(a)ipfire.org>

> On 18 Dec 2021, at 13:57, Peter Müller <peter.mueller(a)ipfire.org> wrote:
> 
> Suggested-by: Michael Tremer <michael.tremer(a)ipfire.org>
> Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
> ---
> 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.)
> -- 
> 2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-20 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-18 12:57 [PATCH] location-importer.in: Do not make things more complicated than they are Peter Müller
2021-12-20 16:54 ` Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox