Skip to content
Open
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
7 changes: 6 additions & 1 deletion coriolis/osmorphing/redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from coriolis.osmorphing import base

RED_HAT_DISTRO_IDENTIFIER = "Red Hat Enterprise Linux"
# RHEL 7 os-release NAME includes the "Server" variant. RHEL 8+ does not.
RED_HAT_SERVER_DISTRO_IDENTIFIER = "Red Hat Enterprise Linux Server"

LOG = logging.getLogger(__name__)

Expand All @@ -28,7 +30,10 @@ class BaseRedHatMorphingTools(base.BaseLinuxOSMorphingTools):

@classmethod
def check_os_supported(cls, detected_os_info):
if detected_os_info['distribution_name'] != (RED_HAT_DISTRO_IDENTIFIER):
if detected_os_info['distribution_name'] not in (
RED_HAT_DISTRO_IDENTIFIER,
RED_HAT_SERVER_DISTRO_IDENTIFIER,
):
return False
return cls._version_supported_util(
detected_os_info['release_version'], minimum=7
Expand Down
12 changes: 12 additions & 0 deletions coriolis/tests/osmorphing/test_redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ def test_check_os_supported_release_version(self, release_version, expected):
)
self.assertEqual(expected, result)

def test_check_os_supported_rhel7_server_name(self):
self.detected_os_info['distribution_name'] = (
redhat.RED_HAT_SERVER_DISTRO_IDENTIFIER
)
self.detected_os_info['release_version'] = '7.9'

result = redhat.BaseRedHatMorphingTools.check_os_supported(
self.detected_os_info
)

self.assertTrue(result)

def test_check_os_not_supported(self):
self.detected_os_info['distribution_name'] = 'unsupported'

Expand Down
Loading