]> git.ipfire.org Git - location/libloc.git/commitdiff
export: Enable flattening for everything
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 Apr 2022 17:57:22 +0000 (17:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 11 Apr 2022 18:01:55 +0000 (18:01 +0000)
When performing checks, it is useful to be able to rely on a flat
network plan so that any larger parent networks in some countries/ASes
won't match any subnets.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/export.py

index 4a2af8dc56a8f571cb066577e3196d2ca3df7944..3cdece43b0b476606678275508c08911630ac751 100644 (file)
@@ -44,9 +44,6 @@ class OutputWriter(object):
        suffix = "networks"
        mode = "w"
 
-       # Enable network flattening (i.e. networks cannot overlap)
-       flatten = False
-
        def __init__(self, name, family=None, directory=None, f=None):
                self.name = name
                self.family = family
@@ -211,7 +208,6 @@ class XTGeoIPOutputWriter(OutputWriter):
                the xt_geoip kernel module from xtables-addons.
        """
        mode = "wb"
-       flatten = True
 
        @property
        def tag(self):
@@ -258,7 +254,7 @@ class Exporter(object):
 
                        # Get all networks that match the family
                        networks = self.db.search_networks(family=family,
-                               country_codes=country_codes, asns=asns, flatten=self.writer.flatten)
+                               country_codes=country_codes, asns=asns, flatten=True)
 
                        # Walk through all networks
                        for network in networks: