X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Froles%2Ffiles%2Fmirror_health%2Fmirror-health;h=a4df165a343ee5c400da2a3dd17bbcd76ebd89dc;hb=1e92eaa0c47785f00735ef79c91d21762f88572e;hp=d3df95f37bf2fa06258eae14533316b747fa68ca;hpb=3d8cddc478904d0b4b8d58f99bd2c3cca23bdc42;p=mirror%2Fdsa-puppet.git diff --git a/modules/roles/files/mirror_health/mirror-health b/modules/roles/files/mirror_health/mirror-health index d3df95f37..a4df165a3 100755 --- a/modules/roles/files/mirror_health/mirror-health +++ b/modules/roles/files/mirror_health/mirror-health @@ -45,7 +45,10 @@ def check_uptodate(): latest_ts = max(latest_ts, lm) except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout): pass - local_lm = last_modified(retrieve_from_host('localhost', URL)) + try: + local_lm = last_modified(retrieve_from_host('localhost', URL)) + except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout): + return False logging.debug("lm for localhost: %s", local_lm) if local_lm < latest_ts: logging.info("considering myself unhealthy my ts=%s latest_ts=%s", local_lm, latest_ts)