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

report which OS release was detected as unsupported #1235

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ def check_os_version():
for rel in version.SUPPORTED_VERSIONS:
for ver in version.SUPPORTED_VERSIONS[rel]:
supported_releases.append(rel.upper() + ' ' + ver)
current_release = ' '.join(version.current_version()).upper()
reporting.create_report([
reporting.Title(
'The installed OS version is not supported for the in-place upgrade to the target RHEL version'
),
reporting.Summary(
'The supported OS releases for the upgrade process:'
'{}{}'.format(FMT_LIST_SEPARATOR, FMT_LIST_SEPARATOR.join(supported_releases))
'{}{}\n\nThe detected OS release is: {}'.format(FMT_LIST_SEPARATOR,
FMT_LIST_SEPARATOR.join(supported_releases),
current_release)
),
reporting.Severity(reporting.Severity.HIGH),
reporting.Groups(COMMON_REPORT_TAGS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_no_skip_check(monkeypatch):
def test_not_supported_release(monkeypatch):
monkeypatch.setattr(version, "is_supported_version", lambda: False)
monkeypatch.setattr(version, "get_source_major_version", lambda: '7')
monkeypatch.setattr(version, "current_version", lambda: ('bad', '7'))
monkeypatch.setattr(reporting, "create_report", create_report_mocked())

checkosrelease.check_os_version()
Expand Down