]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
scrapy: comparing dead job skip typeNone 1814/head
authorNitzanMordhai <nmordech@redhat.com>
Thu, 9 Feb 2023 08:42:08 +0000 (08:42 +0000)
committerNitzanMordhai <nmordech@redhat.com>
Thu, 9 Feb 2023 08:42:12 +0000 (08:42 +0000)
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 <nmordec@redhat.com>
teuthology/scrape.py

index a73ec1db6c04995b90606aec83f21d2f0a6db729..e84122e62c384416c62c92ff12c28337d6f18bbf 100644 (file)
@@ -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):