]> git.ipfire.org Git - location/libloc.git/commitdiff
export: Fix generating file names for ipset output
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 Oct 2022 08:47:03 +0000 (08:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 Oct 2022 08:47:03 +0000 (08:47 +0000)
The tag that is being used in the filename was set after creating the
filename. The order has now been fixed and the export works fine for me.

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

index f5ed37f7f2d51e73ff47f1f8b4479d8787203c5e..3f58498ce8a4243f66726da249372c432938743b 100644 (file)
@@ -48,6 +48,9 @@ class OutputWriter(object):
                self.family = family
                self.directory = directory
 
+               # Tag
+               self.tag = self._make_tag()
+
                # Open output file
                if f:
                        self.f = f
@@ -58,9 +61,6 @@ class OutputWriter(object):
                else:
                        self.f = io.StringIO()
 
-               # Tag
-               self.tag = self._make_tag()
-
                # Call any custom initialization
                self.init()