]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
location: Fix handling of families argument
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Jun 2020 14:44:20 +0000 (14:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Jun 2020 14:44:20 +0000 (14:44 +0000)
This was ignored, because it was already converted before
and the export function was expecting a string.

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

index 6ced5f5f099064c8001b3f2ca88a2e42a901da44..d37294da18defe3f334384e6aadba43f37e969f9 100644 (file)
@@ -517,10 +517,8 @@ class CLI(object):
                countries, asns = [], []
 
                # Translate family
-               if ns.family == "ipv6":
-                       families = [ socket.AF_INET6 ]
-               elif ns.family == "ipv4":
-                       families = [ socket.AF_INET ]
+               if ns.family:
+                       families = [ ns.family ]
                else:
                        families = [ socket.AF_INET6, socket.AF_INET ]