Return a new XsaReference from an XSA-XXXX id.
(cls, xsa_id)
| 85 | |
| 86 | @classmethod |
| 87 | def from_id(cls, xsa_id): |
| 88 | """ |
| 89 | Return a new XsaReference from an XSA-XXXX id. |
| 90 | """ |
| 91 | if not xsa_id or not xsa_id.lower().startswith("xsa"): |
| 92 | return ValueError(f"Not a Xen reference. Does not start with XSA: {xsa_id!r}") |
| 93 | _, numid = xsa_id.rsplit("-") |
| 94 | return ReferenceV2( |
| 95 | reference_id=xsa_id, |
| 96 | url=f"https://xenbits.xen.org/xsa/advisory-{numid}.html", |
| 97 | ) |
| 98 | |
| 99 | @classmethod |
| 100 | def from_number(cls, number): |
nothing calls this directly
no test coverage detected