Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Add missing [extra] for affected prod check
Browse files Browse the repository at this point in the history
  • Loading branch information
major committed Oct 21, 2024
1 parent 40543fb commit b72afc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def test_parse_functional(errata_doc_path):

def test_affects_rhel(tmp_path):
content = """+++
[extra]
portal_product_names=["Red Hat Enterprise Linux Server - Extended Life Cycle Support","Red Hat Enterprise Linux for x86_64 - Update Services for SAP Solutions","Red Hat Enterprise Linux for x86_64 - Extended Update Support","Red Hat Enterprise Linux Desktop","Red Hat Enterprise Linux Server - AUS","Red Hat Enterprise Linux EUS Compute Node","Red Hat Enterprise Linux Server - TUS","Red Hat Enterprise Linux Server","Red Hat Enterprise Linux Workstation","Red Hat Enterprise Linux Server from RHUI","Red Hat Enterprise Linux for Scientific Computing"]
+++
Expand All @@ -189,6 +190,7 @@ def test_affects_rhel(tmp_path):
assert affects_rhel(p)

content = """+++
[extra]
portal_product_names=["Red Hat OpenShift Enterprise Infrastructure","Red Hat OpenShift Enterprise Application Node","Red Hat OpenShift Enterprise JBoss EAP add-on","Red Hat OpenShift Enterprise Client Tools"]
+++
Expand Down
2 changes: 1 addition & 1 deletion textprep/errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_affected_products(product_keys: list, product_detail: list) -> str:
def affects_rhel(path: str) -> bool:
"""Check if the errata affects RHEL."""
errata_doc = load_errata(path)
affected_products = errata_doc["frontmatter"]["portal_product_names"]
affected_products = errata_doc["frontmatter"]["extra"]["portal_product_names"]
return any("Red Hat Enterprise Linux" in x for x in affected_products)


Expand Down

0 comments on commit b72afc3

Please sign in to comment.