Use max instead of if to get biggest timestamp
authorTollef Fog Heen <tfheen@err.no>
Sun, 1 Oct 2017 18:27:08 +0000 (20:27 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sun, 1 Oct 2017 18:28:12 +0000 (20:28 +0200)
modules/roles/files/mirror_health/mirror-health

index 49808b3..d3df95f 100755 (executable)
@@ -42,8 +42,7 @@ def check_uptodate():
         try:
             lm = last_modified(retrieve_from_host(host, URL))
             logging.debug("lm for host %s: %s", host, lm)
-            if lm > latest_ts:
-                latest_ts = lm
+            latest_ts = max(latest_ts, lm)
         except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout):
             pass
     local_lm = last_modified(retrieve_from_host('localhost', URL))