]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
task: mon_clock_skew_check: use absolute value when comparing mon_skew
authorJoao Eduardo Luis <jecluis@gmail.com>
Wed, 30 Jan 2013 20:52:39 +0000 (20:52 +0000)
committerJoao Eduardo Luis <jecluis@gmail.com>
Wed, 30 Jan 2013 20:52:39 +0000 (20:52 +0000)
The monitors may report either positive or negative clock skews, and by
not using an absolute value we were constantly ignoring reported negative
clock skews.

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
teuthology/task/mon_clock_skew_check.py

index c48efd9c4dbf6c443a033bfaf572232079bf8d39..634eaa2a182c81d779af29fd534150fa24540bd4 100644 (file)
@@ -144,13 +144,13 @@ class ClockSkewCheck:
         mon_skew = float(check['skew'])
         mon_health = check['health']
         mon_id = check['name']
-        if mon_skew > self.max_skew:
+        if abs(mon_skew) > self.max_skew:
           assert mon_health == 'HEALTH_WARN', \
               'mon.{id} health is \'{health}\' but skew {s} > max {ms}'.format(
-                  id=mon_id,s=mon_skew,ms=self.max_skew)
+                  id=mon_id,s=abs(mon_skew),ms=self.max_skew)
 
           log_str = 'mon.{id} with skew {s} > max {ms}'.format(
-            id=mon_id,s=mon_skew,ms=self.max_skew)
+            id=mon_id,s=abs(mon_skew),ms=self.max_skew)
 
           """ add to skew list """
           details = check['details']