Skip to content

Commit 9fbfe50

Browse files
committed
Fix codestyle
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
1 parent 89a5b01 commit 9fbfe50

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

vulnerabilities/importers/redhat.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
# VulnerableCode is a free software code from nexB Inc. and others.
2121
# Visit https://github.com/nexB/vulnerablecode/ for support and download.
2222

23-
24-
import json
25-
2623
from packageurl import PackageURL
2724
import requests
2825

@@ -54,7 +51,7 @@ def fetch():
5451
"""
5552
cves = []
5653
page_no = 1
57-
url_template = "https://access.redhat.com/hydra/rest/securitydata/cve.json?per_page=10&page={}"
54+
url_template = "https://access.redhat.com/hydra/rest/securitydata/cve.json?per_page=10000&page={}" # nopep8
5855

5956
cve_data = None
6057
while True:
@@ -78,7 +75,6 @@ def fetch():
7875
cves.extend(cve_data)
7976
page_no += 1
8077

81-
print(f"Fetched {len(cves)} CVEs from: {current_url}")
8278
return cves
8379

8480

@@ -152,9 +148,8 @@ def to_advisory(advisory_data):
152148
)
153149

154150
references.append(Reference(severities=redhat_scores, url=advisory_data["resource_url"]))
155-
156151
return Advisory(
157-
cve_id=advisory_data["CVE"],
152+
vulnerability_id=advisory_data["CVE"],
158153
summary=advisory_data["bugzilla_description"],
159154
impacted_package_urls=affected_purls,
160155
vuln_references=references,
@@ -163,7 +158,7 @@ def to_advisory(advisory_data):
163158

164159
def rpm_to_purl(rpm_string):
165160
# FIXME: there is code in scancode to handle RPM conversion AND this should
166-
# be all be part of the pcakageurl library
161+
# be all be part of the packageurl library
167162

168163
# Red Hat uses `-:0` instead of just `-` to separate
169164
# package name and version

0 commit comments

Comments
 (0)