]> git.ipfire.org Git - location/libloc.git/commitdiff
location-exporter: Warn, but do not fail on invalid input
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 3 Jun 2020 16:33:44 +0000 (16:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 3 Jun 2020 16:33:44 +0000 (16:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location-exporter.in

index 54545619f39a3a8dddbe0981e0f85f721223030f..d82f1d3df04aece8b77085d0da4bcc12050a587b 100644 (file)
@@ -270,8 +270,12 @@ class CLI(object):
                                countries.append(object)
 
                        else:
-                               log.error("Invalid argument: %s" % object)
-                               return 2
+                               log.warning("Invalid argument: %s" % object)
+                               continue
+
+               if not countries and not asns:
+                       log.error("Nothing to export")
+                       return 2
 
                # Open the database
                try: