From: Tollef Fog Heen Date: Sun, 1 Oct 2017 18:27:08 +0000 (+0200) Subject: Use max instead of if to get biggest timestamp X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=3d8cddc478904d0b4b8d58f99bd2c3cca23bdc42;p=mirror%2Fdsa-puppet.git Use max instead of if to get biggest timestamp --- 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))