]> git.ipfire.org Git - location/location-database.git/commitdiff
tools: Drop more dead code
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 20:25:29 +0000 (20:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 20:25:29 +0000 (20:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tools/base.py

index 9d71d6c1b3366f8ef0436524ce21aae71d7f6b72..deb4305d0e5adeafe2a68282cfcb946a3b12f743 100644 (file)
@@ -122,82 +122,6 @@ class RIRParser(object):
                with open(self.rir.filename_networks, "w") as f:
                        self._export_networks(f)
 
-       def _export_asnums(self, f):
-               # Write header
-               self._write_header(f)
-
-               with self.db as c:
-                       res = c.execute("""SELECT DISTINCT autnums.asn, autnums.name,
-                               organisations.name, organisations.country FROM autnums
-                               LEFT JOIN organisations ON autnums.org = organisations.handle
-                               WHERE autnums.asn IS NOT NULL ORDER BY autnums.asn""")
-
-                       for row in res:
-                               f.write(FMT % ("asnum:", "AS%s" % row[0]))
-
-                               if row[1]:
-                                       f.write(FMT % ("name:", row[1]))
-
-                               if row[2]:
-                                       f.write(FMT % ("org:", row[2]))
-
-                               if row[3]:
-                                       f.write(FMT % ("country:", row[3]))
-
-                               # End block
-                               f.write("\n")
-
-       def _export_networks(self, f):
-               # Write header
-               self._write_header(f)
-
-               with self.db as c:
-                       # Write all networks
-                       res = c.execute("""
-                               SELECT networks.route,
-                                       networks.asn,
-                                       networks.country,
-                                       networks.netname,
-                                       networks.description FROM (
-                                               SELECT DISTINCT routes.route,
-                                                       routes.address_start,
-                                                       inetnums.network,
-                                                       routes.asn,
-                                                       inetnums.country,
-                                                       inetnums.netname,
-                                                       inetnums.description
-                                               FROM routes
-                                               LEFT JOIN inetnums
-                                                       WHERE routes.family = inetnums.family
-                                                       AND routes.prefix >= inetnums.prefix
-                                                       AND inetnums.address_start <= routes.address_start
-                                                       AND inetnums.address_end >= routes.address_end
-                                               ORDER BY inetnums.prefix DESC
-                                       ) networks
-                               ORDER BY networks.address_start
-                       """)
-
-                       for row in res:
-                               net, asn, country, name, description = row
-
-                               f.write(FMT % ("net:", net))
-
-                               if name:
-                                       f.write(FMT % ("name:", name))
-
-                               if asn:
-                                       f.write(FMT % ("asnum:", "AS%s" % asn))
-
-                               if country:
-                                       f.write(FMT % ("country:", country))
-
-                               if description:
-                                       for line in description.splitlines():
-                                               f.write(FMT % ("descr:", line))
-
-                               # End the block
-                               f.write("\n")
-
        def _write_header(self, f):
                f.write("#\n")
                f.write("# %s\n" % self.rir)