Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add is_rhel_ai to parser of os_release #4313

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

wushiqinlou
Copy link
Contributor

@wushiqinlou wushiqinlou commented Dec 18, 2024

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

All Pull Requests:

Check all that apply:

  • Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
  • No Sensitive Data in this change?
  • Is this PR to correct an issue?
  • Is this PR an enhancement?

Complete Description of Additions/Changes:

Add is_rhel_ai function to check if the system is from RHEL AI image

Signed-off-by: jiazhang <[email protected]>

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
@wushiqinlou wushiqinlou force-pushed the Add_is_rhel_ai_os_release branch from 2540787 to 2430b52 Compare December 18, 2024 10:10
@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.18%. Comparing base (952f219) to head (3127212).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4313      +/-   ##
==========================================
+ Coverage   77.17%   77.18%   +0.01%     
==========================================
  Files         765      765              
  Lines       41753    41773      +20     
  Branches     8815     8821       +6     
==========================================
+ Hits        32221    32243      +22     
+ Misses       8464     8463       -1     
+ Partials     1068     1067       -1     
Flag Coverage Δ
unittests 77.17% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Returns:
bool: True when the system is from RHEL AI image.
"""
return True if self.get("VARIANT", None) == "RHEL AI" and self.get("VARIANT_ID", None) == "rhel_ai" else False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, how about

return self.get("VARIANT") == "RHEL AI" and self.get("VARIANT_ID") == "rhel_ai"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiangce - updated, please confirm

Signed-off-by: jiazhang <[email protected]>

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED
@xiangce xiangce merged commit da76be4 into RedHatInsights:master Dec 20, 2024
13 checks passed
@xiangce xiangce changed the title feat: Add is_rhel_ai into parser os_release feat: Add is_rhel_ai to parser of os_release Dec 20, 2024
xiangce pushed a commit that referenced this pull request Jan 2, 2025
Signed-off-by: jiazhang <[email protected]>

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

(cherry picked from commit da76be4)
xiangce pushed a commit that referenced this pull request Jan 2, 2025
Signed-off-by: jiazhang <[email protected]>

rh-pre-commit.version: 2.3.1
rh-pre-commit.check-secrets: ENABLED

(cherry picked from commit da76be4)
(cherry picked from commit cd9ddc8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants