]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
location: Fix Python syntax error in verify()
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Oct 2020 09:52:36 +0000 (09:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Oct 2020 09:52:36 +0000 (09:52 +0000)
The database is now being opened before the requested
method is called and handle_verify() wasn't updated.

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

index 44ad726743424692a5406d840bcb1c91a1fa57a1..b5e57589b595c39b921cc32f6808b4141ed86b3b 100644 (file)
@@ -453,13 +453,7 @@ class CLI(object):
 
                return 0
 
-       def handle_verify(self, ns):
-               try:
-                       db = location.Database(ns.database)
-               except FileNotFoundError as e:
-                       log.error("%s: %s" % (ns.database, e))
-                       return 127
-
+       def handle_verify(self, db, ns):
                # Verify the database
                with open(ns.public_key, "r") as f:
                        if not db.verify(f):