From 7c1bb886dbdfdc681056a1a93863839726c8747c Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 24 Jan 2017 13:16:44 -0500 Subject: [PATCH] Security scanner ordered tuplize bug fix If only the old list is present, we still need to tuplize the entries. Fixes https://sentry.io/coreos/backend-production/issues/207196561/ --- util/secscan/notifier.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/secscan/notifier.py b/util/secscan/notifier.py index 336514ce9..1cfea4ace 100644 --- a/util/secscan/notifier.py +++ b/util/secscan/notifier.py @@ -112,7 +112,9 @@ class SecurityNotificationHandler(object): # Check for ordered data. If found, we use the indexed tracker, which is faster and # more memory efficient. is_indexed = False - if 'OrderedLayersIntroducingVulnerability' in new_data: + if ('OrderedLayersIntroducingVulnerability' in new_data or + 'OrderedLayersIntroducingVulnerability' in old_data): + def tuplize(stream): return [(entry['LayerName'], entry['Index']) for entry in stream]