]> git.ipfire.org Git - location/libloc.git/commitdiff
location update: Remove double conversion of timestamps
authorPeter Müller <peter.mueller@ipfire.org>
Thu, 29 Oct 2020 14:25:53 +0000 (07:25 -0700)
committerPeter Müller <peter.mueller@ipfire.org>
Thu, 29 Oct 2020 14:25:53 +0000 (07:25 -0700)
This caused that the timestamp in DNS was misinterpreted
as local time and often, databases could not be downloaded.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
src/python/location.in

index b5e57589b595c39b921cc32f6808b4141ed86b3b..070640c2ae5cd5a07ce3875e76f444d9a2c6d719 100644 (file)
@@ -421,11 +421,8 @@ class CLI(object):
                # Fetch the timestamp we need from DNS
                t = location.discover_latest_version()
 
                # 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
                # 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
 
                        log.info("Already on the latest version")
                        return