mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-22 05:01:26 +00:00
Compat API fix: return RPMs in nvra class
This commit is contained in:
parent
6654d26083
commit
dec33c5de6
@ -72,6 +72,10 @@ class Advisory_Pydantic_V2_Fix(BaseModel):
|
||||
description: str
|
||||
|
||||
|
||||
class Advisory_Pydantic_V2_RPM(BaseModel):
|
||||
nevra: str
|
||||
|
||||
|
||||
class Advisory_Pydantic_V2_CVE(BaseModel):
|
||||
name: str
|
||||
sourceBy: str
|
||||
|
@ -20,7 +20,7 @@ from pydantic import BaseModel
|
||||
from rssgen.feed import RssGenerator
|
||||
|
||||
from apollo.db import Advisory, RedHatIndexState
|
||||
from apollo.db.serialize import Advisory_Pydantic_V2, Advisory_Pydantic_V2_CVE, Advisory_Pydantic_V2_Fix
|
||||
from apollo.db.serialize import Advisory_Pydantic_V2, Advisory_Pydantic_V2_CVE, Advisory_Pydantic_V2_Fix, Advisory_Pydantic_V2_RPM
|
||||
from apollo.server.settings import UI_URL, COMPANY_NAME, MANAGING_EDITOR, get_setting
|
||||
|
||||
from common.fastapi import RenderErrorTemplateException
|
||||
@ -129,8 +129,13 @@ def v3_advisory_to_v2(
|
||||
name = f"{pkg.supported_product.variant} {pkg.supported_products_rh_mirror.match_major_version}"
|
||||
if name not in rpms:
|
||||
rpms[name] = []
|
||||
if pkg.nevra not in rpms[name]:
|
||||
rpms[name].append(pkg.nevra)
|
||||
|
||||
rpms_res = {}
|
||||
for product, rpms in rpms.items():
|
||||
rpms_res[product] = [Advisory_Pydantic_V2_RPM(nevra=x) for x in rpms]
|
||||
|
||||
published_at = advisory.published_at.isoformat("T"
|
||||
).replace("+00:00", "") + "Z"
|
||||
severity = advisory.severity.upper()
|
||||
|
Loading…
Reference in New Issue
Block a user