Skip to content

Commit

Permalink
report which OS release was detected as unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed May 16, 2024
1 parent 2542358 commit a2c48e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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

0 comments on commit a2c48e9

Please sign in to comment.