]> git.ipfire.org Git - location/libloc.git/commitdiff
location-importer.in: Do not make things more complicated than they are
authorPeter Müller <peter.mueller@ipfire.org>
Sat, 18 Dec 2021 12:57:45 +0000 (13:57 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 11 Feb 2022 10:46:08 +0000 (10:46 +0000)
Suggested-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-importer.in

index 63f7be592327e98620c80a5b488c0d6309222baf..83fb5c7d3360443de5cf1057140bdb434c59defd 100644 (file)
@@ -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.)