mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-25 14:41:28 +00:00
Further fix rpms in compat API
This commit is contained in:
parent
dec33c5de6
commit
77cab63d2f
@ -99,7 +99,7 @@ class Advisory_Pydantic_V2(BaseModel):
|
|||||||
cves: list[Advisory_Pydantic_V2_CVE]
|
cves: list[Advisory_Pydantic_V2_CVE]
|
||||||
references: list[str]
|
references: list[str]
|
||||||
publishedAt: str
|
publishedAt: str
|
||||||
rpms: dict[str, list[str]]
|
rpms: dict[str, list[Advisory_Pydantic_V2_RPM]]
|
||||||
rebootSuggested: bool
|
rebootSuggested: bool
|
||||||
buildReferences: list[str]
|
buildReferences: list[str]
|
||||||
|
|
||||||
|
@ -133,8 +133,11 @@ def v3_advisory_to_v2(
|
|||||||
rpms[name].append(pkg.nevra)
|
rpms[name].append(pkg.nevra)
|
||||||
|
|
||||||
rpms_res = {}
|
rpms_res = {}
|
||||||
for product, rpms in rpms.items():
|
if include_rpms:
|
||||||
rpms_res[product] = [Advisory_Pydantic_V2_RPM(nevra=x) for x in rpms]
|
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"
|
published_at = advisory.published_at.isoformat("T"
|
||||||
).replace("+00:00", "") + "Z"
|
).replace("+00:00", "") + "Z"
|
||||||
@ -153,7 +156,7 @@ def v3_advisory_to_v2(
|
|||||||
shortCode=advisory.name[0:2],
|
shortCode=advisory.name[0:2],
|
||||||
topic=advisory.topic if advisory.topic else "",
|
topic=advisory.topic if advisory.topic else "",
|
||||||
solution=None,
|
solution=None,
|
||||||
rpms=rpms,
|
rpms=rpms_res,
|
||||||
affectedProducts=affected_products,
|
affectedProducts=affected_products,
|
||||||
references=[],
|
references=[],
|
||||||
rebootSuggested=False,
|
rebootSuggested=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user