From c030cf41ed55936d4fb04121d3e30d23ad46f691 Mon Sep 17 00:00:00 2001 From: Fabian Fulga Date: Wed, 28 Oct 2026 11:36:17 +0200 Subject: [PATCH] Fix RHEL 7 morphing selection for the Server os-release name --- coriolis/osmorphing/redhat.py | 7 ++++++- coriolis/tests/osmorphing/test_redhat.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/coriolis/osmorphing/redhat.py b/coriolis/osmorphing/redhat.py index 086fd373..35a0bacd 100644 --- a/coriolis/osmorphing/redhat.py +++ b/coriolis/osmorphing/redhat.py @@ -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__) @@ -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 diff --git a/coriolis/tests/osmorphing/test_redhat.py b/coriolis/tests/osmorphing/test_redhat.py index 21f0e1e9..e22a8bf6 100644 --- a/coriolis/tests/osmorphing/test_redhat.py +++ b/coriolis/tests/osmorphing/test_redhat.py @@ -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'