From e842069ceeca4fdba9e9f01c312f84240b56eb4a Mon Sep 17 00:00:00 2001 From: NitzanMordhai Date: Thu, 9 Feb 2023 08:42:08 +0000 Subject: [PATCH] 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 --- teuthology/scrape.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/teuthology/scrape.py b/teuthology/scrape.py index a73ec1db6c..e84122e62c 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): -- 2.39.5