Skip to content

Commit

Permalink
fix: use USNs directly from the CVE response
Browse files Browse the repository at this point in the history
We need to fetch the USNs related to a CVE to extract the ubuntu
version of the packages affected by the CVE. In the past, we
where running another request to fetch all USNs related to the CVEs.
To make this process less demanding on the API side, we are now
relaying on the related USNs already delivered by the CVE endpoint
instead
  • Loading branch information
lucasmoura committed Oct 7, 2024
1 parent 9bda3a7 commit bf334ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion uaclient/api/u/pro/security/fix/_common/plan/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def _get_cve_data(
) -> Tuple[CVE, List[USN]]:
try:
cve = client.get_cve(cve_id=issue_id)
usns = client.get_notices(cves=issue_id)
usns = cve.notices
except exceptions.SecurityAPIError as e:
if e.code == 404:
raise exceptions.SecurityIssueNotFound(issue_id=issue_id)
Expand Down

0 comments on commit bf334ad

Please sign in to comment.