Fix logic in healthy/unhealthy
authorTollef Fog Heen <tfheen@err.no>
Sat, 30 Sep 2017 20:05:55 +0000 (22:05 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sat, 30 Sep 2017 20:05:55 +0000 (22:05 +0200)
modules/roles/files/mirror_health/mirror-health

index c2ef590..6214882 100755 (executable)
@@ -37,8 +37,8 @@ while True:
         if lm > latest_ts:
             latest_ts = lm
     local_lm = last_modified(retrieve_from_host('localhost', URL))
-    logging.debug("lm for localhost: %s", lm)
-    if latest_ts <= local_lm:
+    logging.debug("lm for localhost: %s", local_lm)
+    if local_lm < latest_ts:
         try:
             logging.info("considering myself unhealthy my ts=%s latest_ts=%s", local_lm, latest_ts)
             os.remove(HEALTH_FILE)