From: Joao Eduardo Luis Date: Wed, 30 Jan 2013 20:52:39 +0000 (+0000) Subject: task: mon_clock_skew_check: use absolute value when comparing mon_skew X-Git-Tag: v0.94.10~27^2^2~364^2~1060 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a63fac32f859cd827814bd4bfce26a5f31cf97cf;p=ceph.git task: mon_clock_skew_check: use absolute value when comparing mon_skew 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 --- diff --git a/teuthology/task/mon_clock_skew_check.py b/teuthology/task/mon_clock_skew_check.py index c48efd9c4dbf..634eaa2a182c 100644 --- a/teuthology/task/mon_clock_skew_check.py +++ b/teuthology/task/mon_clock_skew_check.py @@ -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']