From: NitzanMordhai Date: Thu, 9 Feb 2023 08:42:08 +0000 (+0000) Subject: scrapy: comparing dead job skip typeNone X-Git-Tag: 1.2.0~127^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1814%2Fhead;p=teuthology.git scrapy: comparing dead job skip typeNone SequenceMatcher can't get NoneType when comparing 2 dead jobs, adding check and compare for those jobs. Fixes: https://tracker.ceph.com/issues/58264 Signed-off-by: Nitzan Mordechai --- diff --git a/teuthology/scrape.py b/teuthology/scrape.py index a73ec1db6..e84122e62 100644 --- a/teuthology/scrape.py +++ b/teuthology/scrape.py @@ -198,12 +198,13 @@ class DeadReason(Reason): else: # I have BT but he doesn't, so we're different return False - - if self.last_tlog_line or job.get_last_tlog_line(): + last_tlog_line = job.get_last_tlog_line() + if self.last_tlog_line is not None and last_tlog_line is not None: ratio = difflib.SequenceMatcher(None, self.last_tlog_line, - job.get_last_tlog_line()).ratio() + last_tlog_line).ratio() return ratio > 0.5 - return True + else: + return self.last_tlog_line == last_tlog_line class TimeoutReason(Reason):