Skip to content

Commit 1234e45

Browse files
committed
Address review comments
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent 4335d98 commit 1234e45

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

  • vulnerabilities/importers

vulnerabilities/importers/xen.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,22 @@ class XenImporter(Importer):
2626

2727
def advisory_data(self):
2828
data = fetch_response(self.url).json()
29-
if not len(data):
29+
# The data looks like this
30+
# [
31+
# {
32+
# "xsas": [
33+
# {
34+
# "cve": [
35+
# "CVE-2012-5510"
36+
# ],
37+
# "title": "XSA-1: Xen security advisory",
38+
# }
39+
# ]
40+
# }
41+
# ]
42+
if not data:
3043
return []
31-
xsas = data[0].get("xsas") or []
44+
xsas = data[0]["xsas"]
3245
for xsa in xsas:
3346
yield from self.to_advisories(xsa)
3447

0 commit comments

Comments
 (0)