]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
export: Raise an error when trying to export ipset for both families
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Jul 2023 15:05:13 +0000 (15:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Jul 2023 15:05:13 +0000 (15:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location/export.py

index 25a532e5438c6ef749fbbcc21e1bc1b0db1c6b8a..1d147b1fc998b96b73a3d24431fdb923d94b6fb4 100644 (file)
@@ -147,6 +147,10 @@ class IpsetOutputWriter(OutputWriter):
                # Count all networks
                self.networks = 0
 
+               # Check that family is being set
+               if not self.family:
+                       raise ValueError("%s requires family being set" % self.__class__.__name__)
+
        @property
        def hashsize(self):
                """