]> git.ipfire.org Git - location/location-database.git/commitdiff
tools: Fix skipping the version line
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 20:42:40 +0000 (20:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 20:42:40 +0000 (20:42 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tools/base.py

index c04a09643430e46dccaea5875ebd5cccb70e5d1f..bdd7fbd656aa400c1fa97dcefe401adaea8ec1ef 100644 (file)
@@ -140,14 +140,14 @@ class RIRParser(object):
 
        def parse_url(self, url):
                with self.downloader.request(url) as r:
-                       for i, line in enumerate(r):
-                               # Skip the first line
-                               if i == 0:
-                                       continue
-
+                       for line in r:
                                self.parse_line(line)
 
        def parse_line(self, line):
+               # Skip version line
+               if line.startswith("2"):
+                       return
+
                # Skip comments
                if line.startswith("#"):
                        return