File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -183,22 +183,21 @@ def generate_summary(cve: dict) -> str:
183
183
"""Generates summary from title & affected product"""
184
184
title = ""
185
185
try :
186
- title = f" { cve [' containers' ][ ' cna' ][ ' title' ] } "
186
+ title = cve [" containers" ][ " cna" ][ " title" ]
187
187
except :
188
188
try :
189
189
for description in cve ["containers" ]["cna" ]["descriptions" ]:
190
190
if description ["lang" ] in ("en" , "en-US" , "en_US" ):
191
- title = f" { description [' value' ] } "
191
+ title = description [" value" ]
192
192
break
193
193
except :
194
194
try :
195
- title = f" { cve [' containers' ][ ' adp' ][0 ][' title' ] } "
195
+ title = cve [" containers" ][ " adp" ][0 ][" title" ]
196
196
except :
197
197
pass
198
198
199
199
vendor = ""
200
200
product = ""
201
-
202
201
try :
203
202
vendor = cve ["containers" ]["adp" ][0 ]["affected" ][0 ]["vendor" ]
204
203
product = cve ["containers" ]["adp" ][0 ]["affected" ][0 ]["product" ]
@@ -211,7 +210,9 @@ def generate_summary(cve: dict) -> str:
211
210
except :
212
211
pass
213
212
214
- if vendor != "" or product != "" :
213
+ if title == "" :
214
+ return f"[{ vendor } : { product } ]"
215
+ elif vendor != "" or product != "" :
215
216
return f"{ title } [{ vendor } : { product } ]"
216
217
else :
217
218
return title
You can’t perform that action at this time.
0 commit comments