From 3d8cddc478904d0b4b8d58f99bd2c3cca23bdc42 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sun, 1 Oct 2017 20:27:08 +0200 Subject: [PATCH] Use max instead of if to get biggest timestamp --- modules/roles/files/mirror_health/mirror-health | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/roles/files/mirror_health/mirror-health b/modules/roles/files/mirror_health/mirror-health index 49808b316..d3df95f37 100755 --- a/modules/roles/files/mirror_health/mirror-health +++ b/modules/roles/files/mirror_health/mirror-health @@ -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)) -- 2.20.1