From fa8aa3f9ebf534a2adcdb687a2fd7611fd76abb2 Mon Sep 17 00:00:00 2001 From: Preston Watson Date: Thu, 29 Aug 2024 10:20:59 -0400 Subject: [PATCH 1/2] [RHELC-1675] Add handling for rhel9 systems in duplicate package check --- .../actions/system_checks/duplicate_packages.py | 2 +- .../actions/system_checks/duplicate_packages_test.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/convert2rhel/actions/system_checks/duplicate_packages.py b/convert2rhel/actions/system_checks/duplicate_packages.py index 961093f5f9..ff1be62778 100644 --- a/convert2rhel/actions/system_checks/duplicate_packages.py +++ b/convert2rhel/actions/system_checks/duplicate_packages.py @@ -42,7 +42,7 @@ def run(self): self.duplicate_packages_failure() return # For el8 machines we can depend on just the return code being 1 to know the check failed - if system_info.version.major == 8 and ret_code == 1: + if system_info.version.major >= 8 and ret_code == 1: self.duplicate_packages_failure() return duplicate_packages = filter(None, output.split("\n")) diff --git a/convert2rhel/unit_tests/actions/system_checks/duplicate_packages_test.py b/convert2rhel/unit_tests/actions/system_checks/duplicate_packages_test.py index 969e8773e9..8c878b664a 100644 --- a/convert2rhel/unit_tests/actions/system_checks/duplicate_packages_test.py +++ b/convert2rhel/unit_tests/actions/system_checks/duplicate_packages_test.py @@ -55,6 +55,16 @@ def duplicate_packages_action(): "package1.x86_64\npackage1.i686\npackage1.s390x\npackage2.x86_64\npackage2.ppc64le\n", ["package1.x86_64", "package1.i686", "package1.s390x", "package2.x86_64", "package2.ppc64le"], ), + ( + Version(9, 4), + "package1.x86_64\npackage1.s390x\npackage2.x86_64\npackage2.ppc64le\n", + ["package1.x86_64", "package1.s390x", "package2.x86_64", "package2.ppc64le"], + ), + ( + Version(9, 4), + "package1.x86_64\npackage1.i686\npackage1.s390x\npackage2.x86_64\npackage2.ppc64le\n", + ["package1.x86_64", "package1.i686", "package1.s390x", "package2.x86_64", "package2.ppc64le"], + ), ), ) def test_duplicate_packages_error( From 9920f3e08b2a5a6390a2bbcb7148498224b2e651 Mon Sep 17 00:00:00 2001 From: Preston Watson Date: Tue, 3 Sep 2024 09:45:32 -0400 Subject: [PATCH 2/2] Update comment --- convert2rhel/actions/system_checks/duplicate_packages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert2rhel/actions/system_checks/duplicate_packages.py b/convert2rhel/actions/system_checks/duplicate_packages.py index ff1be62778..f150cc5d0e 100644 --- a/convert2rhel/actions/system_checks/duplicate_packages.py +++ b/convert2rhel/actions/system_checks/duplicate_packages.py @@ -41,7 +41,7 @@ def run(self): if system_info.version.major == 7 and "name or service not known" in output.lower(): self.duplicate_packages_failure() return - # For el8 machines we can depend on just the return code being 1 to know the check failed + # For el8+ machines we can depend on just the return code being 1 to know the check failed if system_info.version.major >= 8 and ret_code == 1: self.duplicate_packages_failure() return