From: Michael Tremer Date: Mon, 11 Apr 2022 17:57:22 +0000 (+0000) Subject: export: Enable flattening for everything X-Git-Tag: 0.9.13~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3140aa936081398086434c7917b7d99071ce620;p=location%2Flibloc.git export: Enable flattening for everything 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 --- diff --git a/src/python/export.py b/src/python/export.py index 4a2af8d..3cdece4 100644 --- a/src/python/export.py +++ b/src/python/export.py @@ -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: