Remove debugging symbols and black -l 100
This finally fixes
@@ -32,8 +32,6 @@ from vulnerabilities.helpers import requests_with_5xx_retry
from vulnerabilities.severity_systems import scoring_systems
-import pdb
-
class RedhatDataSource(DataSource):
CONFIG_CLASS = DataSourceConfiguration
@@ -85,7 +83,6 @@ def fetch():
def to_advisory(advisory_data):
- try:
affected_purls = []
if advisory_data.get("affected_packages"):
for rpm in advisory_data["affected_packages"]:
@@ -132,10 +129,12 @@ def to_advisory(advisory_data):
if rhsa_data.get("cvrfdoc"):
# not all RHSA errata have a corresponding CVRF document
value = rhsa_data["cvrfdoc"]["aggregate_severity"]
- rhsa_aggregate_severities.append(VulnerabilitySeverity(
+ rhsa_aggregate_severities.append(
+ VulnerabilitySeverity(
system=scoring_systems["rhas"],
value=value,
- ))
+ )
+ )
references.append(
Reference(
@@ -146,9 +145,7 @@ def to_advisory(advisory_data):
)
else:
- references.append(
- Reference(severities=[], url=url, reference_id=rh_adv)
- )
+ references.append(Reference(severities=[], url=url, reference_id=rh_adv))
redhat_scores = []
cvssv3_score = advisory_data.get("cvss3_score")
@@ -169,18 +166,13 @@ def to_advisory(advisory_data):
)
)
- references.append(
- Reference(severities=redhat_scores, url=advisory_data["resource_url"])
- )
+ references.append(Reference(severities=redhat_scores, url=advisory_data["resource_url"]))
return Advisory(
vulnerability_id=advisory_data["CVE"],
summary=advisory_data["bugzilla_description"],
impacted_package_urls=affected_purls,
references=references,
)
- except Exception as e:
- print(e)
- pdb.set_trace()
def rpm_to_purl(rpm_string):
