2023-02-01 21:37:16 +00:00
|
|
|
import asyncio
|
|
|
|
from __init__ import API, Architecture
|
|
|
|
|
|
|
|
|
|
|
|
async def main():
|
|
|
|
api = API()
|
|
|
|
res = await api.search(
|
|
|
|
detected_product="rhel",
|
2023-06-24 18:35:45 +00:00
|
|
|
rows=999,
|
2023-02-01 21:37:16 +00:00
|
|
|
from_date="2019-05-05T22:00:00Z",
|
2023-06-24 18:35:45 +00:00
|
|
|
sort_asc=True,
|
2023-02-01 21:37:16 +00:00
|
|
|
)
|
|
|
|
contains_9 = 0
|
|
|
|
contains_8 = 0
|
|
|
|
contains_90eus = 0
|
|
|
|
for advisory in res:
|
|
|
|
if advisory.affects_rhel_version_arch(9, None, Architecture.X86_64):
|
|
|
|
print(f"{advisory.id} affects RHEL 9 x86_64")
|
|
|
|
contains_9 += 1
|
|
|
|
elif advisory.affects_rhel_version_arch(9, 0, Architecture.X86_64):
|
|
|
|
print(f"{advisory.id} affects RHEL 9.0 EUS x86_64")
|
|
|
|
contains_90eus += 1
|
|
|
|
elif advisory.affects_rhel_version_arch(8, None, Architecture.X86_64):
|
|
|
|
print(f"{advisory.id} affects RHEL 8 x86_64")
|
|
|
|
contains_8 += 1
|
|
|
|
print(f"Found {contains_9} advisories that affect RHEL 9 x86_64")
|
|
|
|
print(f"Found {contains_8} advisories that affect RHEL 8 x86_64")
|
|
|
|
print(f"Found {contains_90eus} advisories that affect RHEL 9.0 EUS x86_64")
|
|
|
|
print(f"Found {len(res)} advisories in total")
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
asyncio.run(main())
|