]> git.ipfire.org Git - location/libloc.git/blobdiff - src/python/location.in
location update: Remove double conversion of timestamps
[location/libloc.git] / src / python / location.in
index 44ad726743424692a5406d840bcb1c91a1fa57a1..070640c2ae5cd5a07ce3875e76f444d9a2c6d719 100644 (file)
@@ -421,11 +421,8 @@ class CLI(object):
                # Fetch the timestamp we need from DNS
                t = location.discover_latest_version()
 
-               # Parse timestamp into datetime format
-               timestamp = datetime.datetime.utcfromtimestamp(t) if t else None
-
                # Check the version of the local database
-               if db and timestamp and db.created_at >= timestamp.timestamp():
+               if db and t and db.created_at >= t:
                        log.info("Already on the latest version")
                        return
 
@@ -453,13 +450,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):