From: Tollef Fog Heen Date: Sat, 30 Sep 2017 20:59:20 +0000 (+0200) Subject: Add a tiny bit of error handling for health checking X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=89f9c1c280784b10d374e0b357359b50d21fb614;p=mirror%2Fdsa-puppet.git Add a tiny bit of error handling for health checking --- diff --git a/modules/roles/files/mirror_health/mirror-health b/modules/roles/files/mirror_health/mirror-health index 62148828f..ed87f5664 100755 --- a/modules/roles/files/mirror_health/mirror-health +++ b/modules/roles/files/mirror_health/mirror-health @@ -32,10 +32,13 @@ def last_modified(response): while True: start = time.time() for host in HOSTS: - lm = last_modified(retrieve_from_host(host, URL)) - logging.debug("lm for host %s: %s", host, lm) - if lm > latest_ts: - latest_ts = lm + 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 + except requests.exceptions.ProxyError: + pass local_lm = last_modified(retrieve_from_host('localhost', URL)) logging.debug("lm for localhost: %s", local_lm) if local_lm < latest_ts: