Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

verify cves: Allow non-cve aliases in flaws #576

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions elliottlib/cli/verify_attached_bugs_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,11 @@ async def _verify_attached_flaws_for(self, advisory_id: int, attached_trackers:
if flaw_id not in flaw_id_bugs: # This means associated flaw wasn't considered a first fix
continue

if len(flaw_id_bugs[flaw_id].alias) != 1:
raise ValueError(f"Flaw bug {flaw_id} should have exact 1 alias.")
cve = flaw_id_bugs[flaw_id].alias[0]
alias = [k for k in flaw_id_bugs[flaw_id].alias if k.startswith('CVE-')]
if len(alias) != 1:
import pdb; pdb.set_trace()
raise ValueError(f"Bug {flaw_id} should have exactly 1 CVE alias.")
cve = alias[0]
cve_components_mapping.setdefault(cve, set()).add(component_name)

attached_builds = await self.errata_api.get_builds_flattened(advisory_id)
Expand Down
Loading