1 commit 228d0e74ec47c9954d3a0e1da2e1c0fc6c1b518f
2 Author: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Wed Jun 3 16:15:24 2020 +0000
5 location-query: Require at least one flag
7 Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 diff --git a/src/python/location-query.in b/src/python/location-query.in
10 index 5f05b5c..dfdff8c 100644
11 --- a/src/python/location-query.in
12 +++ b/src/python/location-query.in
13 @@ -246,7 +246,13 @@ class CLI(object):
17 - ret = args.func(db, args)
19 + ret = args.func(db, args)
21 + # Catch invalid inputs
22 + except ValueError as e:
23 + sys.stderr.write("%s\n" % e)
26 # Return with exit code
28 @@ -451,6 +457,9 @@ class CLI(object):
30 flags |= location.NETWORK_FLAG_ANYCAST
33 + raise ValueError(_("You must at least pass one flag"))
35 with self.__get_output_formatter(ns) as f:
36 for n in db.search_networks(flags=flags, family=ns.family):