]> git.ipfire.org Git - location/fedora/libloc.git/blob - libloc-0.9.16-export-Raise-an-error-when-trying-to-export-ipset-fo.patch
Fix-string-escaping-in-location-tool.patch accepted
[location/fedora/libloc.git] / libloc-0.9.16-export-Raise-an-error-when-trying-to-export-ipset-fo.patch
1 From 1f2ece2868f370bda1c4c01be401bcfb137f383d Mon Sep 17 00:00:00 2001
2 From: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Mon, 3 Jul 2023 15:05:13 +0000
4 Subject: [PATCH 2/2] export: Raise an error when trying to export ipset for
5 both families
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
11 Signed-off-by: Petr Písař <ppisar@redhat.com>
12 ---
13 src/python/location/export.py | 4 ++++
14 1 file changed, 4 insertions(+)
15
16 diff --git a/src/python/location/export.py b/src/python/location/export.py
17 index 25a532e..1d147b1 100644
18 --- a/src/python/location/export.py
19 +++ b/src/python/location/export.py
20 @@ -147,6 +147,10 @@ class IpsetOutputWriter(OutputWriter):
21 # Count all networks
22 self.networks = 0
23
24 + # Check that family is being set
25 + if not self.family:
26 + raise ValueError("%s requires family being set" % self.__class__.__name__)
27 +
28 @property
29 def hashsize(self):
30 """
31 --
32 2.41.0
33