diff --git a/SOURCES/0001-pcidevicesscanner-Also-match-deprecation-data-agains.patch1 b/SOURCES/0001-pcidevicesscanner-Also-match-deprecation-data-agains.patch1 deleted file mode 100644 index 00949e8..0000000 --- a/SOURCES/0001-pcidevicesscanner-Also-match-deprecation-data-agains.patch1 +++ /dev/null @@ -1,70 +0,0 @@ -From b4fc2e0ae62e68dd246ed2eedda0df2a3ba90633 Mon Sep 17 00:00:00 2001 -From: Vinzenz Feenstra -Date: Fri, 1 Apr 2022 15:13:51 +0200 -Subject: [PATCH] pcidevicesscanner: Also match deprecation data against kernel - modules - -Previously when the deprecation data got introduced the kernel drivers -reported to be used by lspci have not been checked. -This patch fixes this regression. - -Signed-off-by: Vinzenz Feenstra ---- - .../libraries/pcidevicesscanner.py | 29 ++++++++++++++++++- - 1 file changed, 28 insertions(+), 1 deletion(-) - -diff --git a/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py b/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py -index 146f1a33..0f02bd02 100644 ---- a/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py -+++ b/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py -@@ -1,7 +1,13 @@ - import re - - from leapp.libraries.stdlib import api, run --from leapp.models import DetectedDeviceOrDriver, DeviceDriverDeprecationData, PCIDevice, PCIDevices -+from leapp.models import ( -+ ActiveKernelModulesFacts, -+ DetectedDeviceOrDriver, -+ DeviceDriverDeprecationData, -+ PCIDevice, -+ PCIDevices -+) - - # Regex to capture Vendor, Device and SVendor and SDevice values - PCI_ID_REG = re.compile(r"(?<=Vendor:\t|Device:\t)\w+") -@@ -82,6 +88,26 @@ def produce_detected_devices(devices): - ]) - - -+def produce_detected_drivers(devices): -+ active_modules = { -+ module.file_name -+ for message in api.consume(ActiveKernelModulesFacts) for module in message.kernel_modules -+ } -+ -+ # Create a lookup by driver_name and filter out the kernel that are active -+ entry_lookup = { -+ entry.driver_name: entry -+ for message in api.consume(DeviceDriverDeprecationData) for entry in message.entries -+ if entry.driver_name and entry.driver_name not in active_modules -+ } -+ -+ drivers = {device.driver for device in devices if device.driver in entry_lookup} -+ api.produce(*[ -+ DetectedDeviceOrDriver(**entry_lookup[driver].dump()) -+ for driver in drivers -+ ]) -+ -+ - def produce_pci_devices(producer, devices): - """ Produce a Leapp message with all PCI devices """ - producer(PCIDevices(devices=devices)) -@@ -93,4 +119,5 @@ def scan_pci_devices(producer): - pci_numeric = run(['lspci', '-vmmkn'], checked=False)['stdout'] - devices = parse_pci_devices(pci_textual, pci_numeric) - produce_detected_devices(devices) -+ produce_detected_drivers(devices) - produce_pci_devices(producer, devices) --- -2.35.1 - diff --git a/SOURCES/0002-pciscanner-Fix-2-issues-in-regards-to-pci-address-ha.patch b/SOURCES/0002-pciscanner-Fix-2-issues-in-regards-to-pci-address-ha.patch deleted file mode 100644 index 4b2809c..0000000 --- a/SOURCES/0002-pciscanner-Fix-2-issues-in-regards-to-pci-address-ha.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 53ceded213ae17ca5d27268bc496e736dfea7e64 Mon Sep 17 00:00:00 2001 -From: Vinzenz Feenstra -Date: Thu, 14 Apr 2022 14:50:07 +0200 -Subject: [PATCH 2/3] pciscanner: Fix 2 issues in regards to pci address - handling - -In a previous patch, the introduction of the new handling of deprecation -data, 2 problems slipped through. - -1. The regex replacement for pci ids errornous adds an empty space - instead of empty string -2. Drivers should be matched on lspci output against the driver - deprecation data only if the pci_id is empty - -Signed-off-by: Vinzenz Feenstra ---- - .../actors/pcidevicesscanner/libraries/pcidevicesscanner.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py b/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py -index 0f02bd02..eb063abb 100644 ---- a/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py -+++ b/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py -@@ -78,7 +78,7 @@ def parse_pci_devices(pci_textual, pci_numeric): - def produce_detected_devices(devices): - prefix_re = re.compile('0x') - entry_lookup = { -- prefix_re.sub(' ', entry.device_id): entry -+ prefix_re.sub('', entry.device_id): entry - for message in api.consume(DeviceDriverDeprecationData) for entry in message.entries - } - api.produce(*[ -@@ -98,7 +98,7 @@ def produce_detected_drivers(devices): - entry_lookup = { - entry.driver_name: entry - for message in api.consume(DeviceDriverDeprecationData) for entry in message.entries -- if entry.driver_name and entry.driver_name not in active_modules -+ if not entry.device_id and entry.driver_name and entry.driver_name not in active_modules - } - - drivers = {device.driver for device in devices if device.driver in entry_lookup} --- -2.35.1 - diff --git a/SOURCES/0003-Ensure-the-right-repositories-are-enabled-on-Satelli.patch b/SOURCES/0003-Ensure-the-right-repositories-are-enabled-on-Satelli.patch deleted file mode 100644 index aa04a8a..0000000 --- a/SOURCES/0003-Ensure-the-right-repositories-are-enabled-on-Satelli.patch +++ /dev/null @@ -1,78 +0,0 @@ -From a1fdabea9c00a96ffc1504577f12733e1c1830ee Mon Sep 17 00:00:00 2001 -From: Evgeni Golov -Date: Thu, 7 Apr 2022 14:56:18 +0200 -Subject: [PATCH 3/3] Ensure the right repositories are enabled on Satellite - Capsules - ---- - .../actors/satellite_upgrade_facts/actor.py | 6 +++- - .../unit_test_satellite_upgrade_facts.py | 34 ++++++++++++++++++- - 2 files changed, 38 insertions(+), 2 deletions(-) - -diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py -index eb87cd68..fb83107e 100644 ---- a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py -+++ b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py -@@ -129,6 +129,10 @@ class SatelliteUpgradeFacts(Actor): - modules_to_enable=modules_to_enable - ) - ) -- repositories_to_enable = ['ansible-2.9-for-rhel-8-x86_64-rpms', 'satellite-6.11-for-rhel-8-x86_64-rpms', -+ repositories_to_enable = ['ansible-2.9-for-rhel-8-x86_64-rpms', - 'satellite-maintenance-6.11-for-rhel-8-x86_64-rpms'] -+ if has_package(InstalledRPM, 'foreman'): -+ repositories_to_enable.append('satellite-6.11-for-rhel-8-x86_64-rpms') -+ else: -+ repositories_to_enable.append('satellite-capsule-6.11-for-rhel-8-x86_64-rpms') - self.produce(RepositoriesSetupTasks(to_enable=repositories_to_enable)) -diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py -index 5c8e79ff..e77b7b58 100644 ---- a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py -+++ b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py -@@ -1,6 +1,14 @@ - import os - --from leapp.models import DNFWorkaround, InstalledRPM, Module, RPM, RpmTransactionTasks, SatelliteFacts -+from leapp.models import ( -+ DNFWorkaround, -+ InstalledRPM, -+ Module, -+ RepositoriesSetupTasks, -+ RPM, -+ RpmTransactionTasks, -+ SatelliteFacts -+) - from leapp.snactor.fixture import current_actor_context - - RH_PACKAGER = 'Red Hat, Inc. ' -@@ -87,3 +95,27 @@ def test_detects_remote_postgresql(current_actor_context): - assert not satellitemsg.postgresql.local_postgresql - - assert not current_actor_context.consume(DNFWorkaround) -+ -+ -+def test_enables_right_repositories_on_satellite(current_actor_context): -+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM])) -+ current_actor_context.run() -+ -+ rpmmessage = current_actor_context.consume(RepositoriesSetupTasks)[0] -+ -+ assert 'ansible-2.9-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable -+ assert 'satellite-maintenance-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable -+ assert 'satellite-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable -+ assert 'satellite-capsule-6.11-for-rhel-8-x86_64-rpms' not in rpmmessage.to_enable -+ -+ -+def test_enables_right_repositories_on_capsule(current_actor_context): -+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_PROXY_RPM])) -+ current_actor_context.run() -+ -+ rpmmessage = current_actor_context.consume(RepositoriesSetupTasks)[0] -+ -+ assert 'ansible-2.9-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable -+ assert 'satellite-maintenance-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable -+ assert 'satellite-6.11-for-rhel-8-x86_64-rpms' not in rpmmessage.to_enable -+ assert 'satellite-capsule-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable --- -2.35.1 - diff --git a/SOURCES/0004-Enforce-the-removal-of-rubygem-irb-do-not-install-it.patch b/SOURCES/0004-Enforce-the-removal-of-rubygem-irb-do-not-install-it.patch deleted file mode 100644 index 1cc62cc..0000000 --- a/SOURCES/0004-Enforce-the-removal-of-rubygem-irb-do-not-install-it.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 496abd1775779054377c5e35ae96fa4d390bab42 Mon Sep 17 00:00:00 2001 -From: Petr Stodulka -Date: Tue, 19 Apr 2022 21:51:03 +0200 -Subject: [PATCH] Enforce the removal of rubygem-irb (do not install it) - ---- - etc/leapp/transaction/to_remove | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/etc/leapp/transaction/to_remove b/etc/leapp/transaction/to_remove -index 0feb782..07c6864 100644 ---- a/etc/leapp/transaction/to_remove -+++ b/etc/leapp/transaction/to_remove -@@ -1,3 +1,6 @@ - ### List of packages (each on new line) to be removed from the upgrade transaction - # Removing initial-setup package to avoid it asking for EULA acceptance during upgrade - OAMG-1531 - initial-setup -+ -+# temporary workaround for the file conflict symlink <-> dir (#2030627) -+rubygem-irb --- -2.35.1 - diff --git a/SOURCES/0005-IPU-8-9-Migrate-blacklisted-CAs-hotfix.patch b/SOURCES/0005-IPU-8-9-Migrate-blacklisted-CAs-hotfix.patch deleted file mode 100644 index d7ca5cd..0000000 --- a/SOURCES/0005-IPU-8-9-Migrate-blacklisted-CAs-hotfix.patch +++ /dev/null @@ -1,209 +0,0 @@ -From eeb4f99f57c67937ea562fce11fd5607470ae0a6 Mon Sep 17 00:00:00 2001 -From: Petr Stodulka -Date: Fri, 22 Apr 2022 00:20:15 +0200 -Subject: [PATCH] [IPU 8 -> 9] Migrate blacklisted CAs (hotfix) - -Preserve blacklisted certificates during the IPU 8 -> 9 - -Path for the blacklisted certificates has been changed on RHEL 9. -The original paths on RHEL 8 and older systems have been: - /etc/pki/ca-trust/source/blacklist/ - /usr/share/pki/ca-trust-source/blacklist/ -However on RHEL 9 the blacklist directory has been renamed to 'blocklist'. -So the paths are: - /etc/pki/ca-trust/source/blocklist/ - /usr/share/pki/ca-trust-source/blocklist/ -This actor moves all blacklisted certificates into the expected directories -and fix symlinks if to point to the new dirs if they originally pointed -to one of obsoleted dirs. - -Covered cases: -- covered situations with missing dirs -- covered both mentioned blacklist directories -- update symlinks in case they point to one of obsoleted directories -- remove obsoleted directories when all files migrated successfully -- execute /usr/bin/update-ca-trust in the end -- remove original a blacklist directory in case all discovered files - inside are migrated successfully -- print error logs in case of any issues so the upgrade does not - crash in case of troubles and users could deal with problems - manually after the upgrade - -The actor is not covered by unit-tests as it's just a hotfix. Follow -up works are expected to extend the problem with reports during -preupgrade phases, improve the test coverage, .... - -BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2077432 -Followup ticket: CRYPTO-7097 ---- - .../actors/migrateblacklistca/actor.py | 28 ++++++ - .../libraries/migrateblacklistca.py | 89 +++++++++++++++++++ - .../tests/unit_test_migrateblacklistca.py | 25 ++++++ - 3 files changed, 142 insertions(+) - create mode 100644 repos/system_upgrade/el8toel9/actors/migrateblacklistca/actor.py - create mode 100644 repos/system_upgrade/el8toel9/actors/migrateblacklistca/libraries/migrateblacklistca.py - create mode 100644 repos/system_upgrade/el8toel9/actors/migrateblacklistca/tests/unit_test_migrateblacklistca.py - -diff --git a/repos/system_upgrade/el8toel9/actors/migrateblacklistca/actor.py b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/actor.py -new file mode 100644 -index 00000000..863a0063 ---- /dev/null -+++ b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/actor.py -@@ -0,0 +1,28 @@ -+from leapp.actors import Actor -+from leapp.libraries.actor import migrateblacklistca -+from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag -+ -+ -+class MigrateBlacklistCA(Actor): -+ """ -+ Preserve blacklisted certificates during the upgrade -+ -+ Path for the blacklisted certificates has been changed on RHEL 9. -+ The original paths on RHEL 8 and older systems have been: -+ /etc/pki/ca-trust/source/blacklist/ -+ /usr/share/pki/ca-trust-source/blacklist/ -+ However on RHEL 9 the blacklist directory has been renamed to 'blocklist'. -+ So the new paths are: -+ /etc/pki/ca-trust/source/blocklist/ -+ /usr/share/pki/ca-trust-source/blocklist/ -+ This actor moves all blacklisted certificates into the expected directories -+ and fix symlinks if needed. -+ """ -+ -+ name = 'migrate_blacklist_ca' -+ consumes = () -+ produces = () -+ tags = (ApplicationsPhaseTag, IPUWorkflowTag) -+ -+ def process(self): -+ migrateblacklistca.process() -diff --git a/repos/system_upgrade/el8toel9/actors/migrateblacklistca/libraries/migrateblacklistca.py b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/libraries/migrateblacklistca.py -new file mode 100644 -index 00000000..73c9d565 ---- /dev/null -+++ b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/libraries/migrateblacklistca.py -@@ -0,0 +1,89 @@ -+import os -+import shutil -+ -+from leapp.libraries.stdlib import api, CalledProcessError, run -+ -+# dict(orig_dir: new_dir) -+DIRS_CHANGE = { -+ '/etc/pki/ca-trust/source/blacklist/': '/etc/pki/ca-trust/source/blocklist/', -+ '/usr/share/pki/ca-trust-source/blacklist/': '/usr/share/pki/ca-trust-source/blocklist/' -+} -+ -+ -+def _link_src_path(filepath): -+ """ -+ Return expected target path for the symlink. -+ -+ In case the symlink points to one of dirs supposed to be migrated in this -+ actor, we need to point to the new directory instead. -+ -+ In case the link points anywhere else, keep the target path as it is. -+ """ -+ realpath = os.path.realpath(filepath) -+ for dirname in DIRS_CHANGE: -+ if realpath.startswith(dirname): -+ return realpath.replace(dirname, DIRS_CHANGE[dirname]) -+ -+ # it seems we can keep this path -+ return realpath -+ -+ -+def _migrate_file(filename, src_basedir): -+ dst_path = filename.replace(src_basedir, DIRS_CHANGE[src_basedir]) -+ if os.path.exists(dst_path): -+ api.current_logger().info( -+ 'Skipping migration of the {} certificate. The target file already exists' -+ .format(filename) -+ ) -+ return -+ os.makedirs(os.path.dirname(dst_path), mode=0o755, exist_ok=True) -+ if os.path.islink(filename): -+ # create the new symlink instead of the moving the file -+ # as the target path could be different as well -+ link_src_path = _link_src_path(filename) -+ # TODO: is the broken symlink ok? -+ os.symlink(link_src_path, dst_path) -+ os.unlink(filename) -+ else: -+ # normal file, just move it -+ shutil.move(filename, dst_path) -+ -+ -+def _get_files(dirname): -+ return run(['find', dirname, '-type', 'f,l'], split=True)['stdout'] -+ -+ -+def process(): -+ for dirname in DIRS_CHANGE: -+ if not os.path.exists(dirname): -+ # The directory does not exist; nothing to do here -+ continue -+ try: -+ blacklisted_certs = _get_files(dirname) -+ except (CalledProcessError, OSError) as e: -+ # TODO: create post-upgrade report -+ api.current_logger().error('Cannot get list of files in {}: {}.'.format(dirname, e)) -+ api.current_logger().error('Certificates under {} must be migrated manually.'.format(dirname)) -+ continue -+ failed_files = [] -+ for filename in blacklisted_certs: -+ try: -+ _migrate_file(filename, dirname) -+ except OSError as e: -+ api.current_logger().error( -+ 'Failed migration of blacklisted certificate {}: {}' -+ .format(filename, e) -+ ) -+ failed_files.append(filename) -+ if not failed_files: -+ # the failed removal is not such a big issue here -+ # clean the dir if all files have been migrated successfully -+ shutil.rmtree(dirname, ignore_errors=True) -+ try: -+ run(['/usr/bin/update-ca-trust']) -+ except (CalledProcessError, OSError) as e: -+ api.current_logger().error( -+ 'Cannot update CA trust on the system.' -+ ' It needs to be done manually after the in-place upgrade.' -+ ' Reason: {}'.format(e) -+ ) -diff --git a/repos/system_upgrade/el8toel9/actors/migrateblacklistca/tests/unit_test_migrateblacklistca.py b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/tests/unit_test_migrateblacklistca.py -new file mode 100644 -index 00000000..970dcb97 ---- /dev/null -+++ b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/tests/unit_test_migrateblacklistca.py -@@ -0,0 +1,25 @@ -+import os -+ -+from leapp.libraries.actor import migrateblacklistca -+from leapp.libraries.common.testutils import CurrentActorMocked -+from leapp.libraries.stdlib import api -+ -+ -+class MockedGetFiles(): -+ def __init__(self): -+ self.called = 0 -+ -+ def __call__(self): -+ self.called += 1 -+ return [] -+ -+ -+def test_no_dirs_exist(monkeypatch): -+ mocked_files = MockedGetFiles() -+ monkeypatch.setattr(os.path, 'exists', lambda dummy: False) -+ monkeypatch.setattr(migrateblacklistca, '_get_files', mocked_files) -+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked()) -+ # this is bad mock, but we want to be sure that update-ca-trust is not -+ # called on the testing machine -+ monkeypatch.setattr(migrateblacklistca, 'run', lambda dummy: dummy) -+ assert not mocked_files.called --- -2.35.1 - diff --git a/SOURCES/0006-Skip-comment-lines-when-parsing-grub-configuration-f.patch b/SOURCES/0006-Skip-comment-lines-when-parsing-grub-configuration-f.patch deleted file mode 100644 index 0b99e81..0000000 --- a/SOURCES/0006-Skip-comment-lines-when-parsing-grub-configuration-f.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 32702c7c7d1c445b9ab95e0d1bbdfdf8f06d4303 Mon Sep 17 00:00:00 2001 -From: Petr Stodulka -Date: Wed, 27 Apr 2022 11:25:40 +0200 -Subject: [PATCH] Skip comment lines when parsing grub configuration file - -Added simple unit-test for default grub info to see the valid lines -can be parsed as expected. ---- - .../systemfacts/libraries/systemfacts.py | 21 ++++++++- - .../tests/test_systemfacts_grub.py | 46 +++++++++++++++++++ - 2 files changed, 65 insertions(+), 2 deletions(-) - create mode 100644 repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py - -diff --git a/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py b/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py -index 0de8b383..81aea6f5 100644 ---- a/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py -+++ b/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py -@@ -9,6 +9,7 @@ import re - import six - - from leapp import reporting -+from leapp.exceptions import StopActorExecutionError - from leapp.libraries.common import repofileutils - from leapp.libraries.common.config import architecture - from leapp.libraries.stdlib import api, CalledProcessError, run -@@ -289,9 +290,25 @@ def _default_grub_info(): - ]) - else: - for line in run(['cat', default_grb_fpath], split=True)['stdout']: -- if not line.strip(): -+ line = line.strip() -+ if not line or line[0] == '#': -+ # skip comments and empty lines - continue -- name, value = tuple(map(type(line).strip, line.split('=', 1))) -+ try: -+ name, value = tuple(map(type(line).strip, line.split('=', 1))) -+ except ValueError as e: -+ # we do not want to really continue when we cannot parse this file -+ # TODO(pstodulk): rewrite this in the form we produce inhibitor -+ # with problematic lines. This is improvement just in comparison -+ # to the original hard crash. -+ raise StopActorExecutionError( -+ 'Failed parsing of {}'.format(default_grb_fpath), -+ details={ -+ 'error': str(e), -+ 'problematic line': str(line) -+ } -+ ) -+ - yield DefaultGrub( - name=name, - value=value -diff --git a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py -new file mode 100644 -index 00000000..08552771 ---- /dev/null -+++ b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py -@@ -0,0 +1,46 @@ -+import os -+ -+from leapp.libraries.actor import systemfacts -+from leapp.models import DefaultGrub -+ -+ -+class RunMocked(object): -+ def __init__(self, cmd_result): -+ self.called = 0 -+ self.cmd_result = cmd_result -+ self.split = False -+ self.cmd = None -+ -+ def __call__(self, cmd, split=False): -+ self.cmd = cmd -+ self.split = split -+ self.called += 1 -+ return self.cmd_result -+ -+ -+def test_default_grub_info_valid(monkeypatch): -+ mocked_run = RunMocked({ -+ 'stdout': [ -+ 'line="whatever else here"', -+ 'newline="whatever"', -+ '# comment here', -+ 'why_not=value', -+ ' # whitespaces around comment ', -+ ' ', -+ ' last=last really' -+ ], -+ }) -+ expected_result = [ -+ DefaultGrub(name='line', value='"whatever else here"'), -+ DefaultGrub(name='newline', value='"whatever"'), -+ DefaultGrub(name='why_not', value='value'), -+ DefaultGrub(name='last', value='last really'), -+ ] -+ monkeypatch.setattr(systemfacts, 'run', mocked_run) -+ monkeypatch.setattr(os.path, 'isfile', lambda dummy: True) -+ for msg in systemfacts._default_grub_info(): -+ expected_msg = expected_result.pop(0) -+ assert msg.name == expected_msg.name -+ assert msg.value == expected_msg.value -+ assert mocked_run.called -+ assert not expected_result --- -2.35.1 - diff --git a/SOURCES/leapp-repository-0.16.0-elevate.patch b/SOURCES/leapp-repository-0.16.0-elevate.patch index b3f2be3..94a2878 100644 --- a/SOURCES/leapp-repository-0.16.0-elevate.patch +++ b/SOURCES/leapp-repository-0.16.0-elevate.patch @@ -1,5 +1,5 @@ diff --git a/Makefile b/Makefile -index 3e51e3c..b931920 100644 +index 3e51e3c1..b9319209 100644 --- a/Makefile +++ b/Makefile @@ -209,7 +209,7 @@ install-deps: @@ -12,7 +12,7 @@ index 3e51e3c..b931920 100644 pip install -U pip; \ pip install --upgrade setuptools; \ diff --git a/README.md b/README.md -index 4de458b..c82651d 100644 +index 4de458b2..c82651d6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,61 @@ @@ -739,7 +739,7 @@ index 4de458b..c82651d 100644 -You can reach us at IRC: `#leapp` on freenode. +For more information about Leapp and additional tutorials, visit the [official Leapp documentation](https://leapp.readthedocs.io/en/latest/tutorials.html). diff --git a/commands/command_utils.py b/commands/command_utils.py -index da62c50..f062f78 100644 +index da62c50d..f062f787 100644 --- a/commands/command_utils.py +++ b/commands/command_utils.py @@ -12,7 +12,7 @@ LEAPP_UPGRADE_FLAVOUR_DEFAULT = 'default' @@ -792,7 +792,7 @@ index da62c50..f062f78 100644 def get_upgrade_paths_config(): diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py -index c9c2741..911d11d 100644 +index c9c2741c..911d11da 100644 --- a/commands/upgrade/__init__.py +++ b/commands/upgrade/__init__.py @@ -18,6 +18,7 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i @@ -836,7 +836,7 @@ index c9c2741..911d11d 100644 diff --git a/commands/upgrade/util.py b/commands/upgrade/util.py -index 75ffa6a..2aae399 100644 +index 75ffa6a6..2aae3997 100644 --- a/commands/upgrade/util.py +++ b/commands/upgrade/util.py @@ -2,18 +2,25 @@ import functools @@ -975,15 +975,26 @@ index 75ffa6a..2aae399 100644 + logger.info('Consult the pre-upgrade report for details and possible remediation.') diff --git a/etc/leapp/transaction/to_reinstall b/etc/leapp/transaction/to_reinstall new file mode 100644 -index 0000000..c6694a8 +index 00000000..c6694a8e --- /dev/null +++ b/etc/leapp/transaction/to_reinstall @@ -0,0 +1,3 @@ +### List of packages (each on new line) to be reinstalled to the upgrade transaction +### Useful for packages that have identical version strings but contain binary changes between major OS versions +### Packages that aren't installed will be skipped +diff --git a/etc/leapp/transaction/to_remove b/etc/leapp/transaction/to_remove +index 0feb7827..07c68649 100644 +--- a/etc/leapp/transaction/to_remove ++++ b/etc/leapp/transaction/to_remove +@@ -1,3 +1,6 @@ + ### List of packages (each on new line) to be removed from the upgrade transaction + # Removing initial-setup package to avoid it asking for EULA acceptance during upgrade - OAMG-1531 + initial-setup ++ ++# temporary workaround for the file conflict symlink <-> dir (#2030627) ++rubygem-irb diff --git a/packaging/leapp-repository.spec b/packaging/leapp-repository.spec -index af4b31d..0d8f6c8 100644 +index af4b31dd..0d8f6c83 100644 --- a/packaging/leapp-repository.spec +++ b/packaging/leapp-repository.spec @@ -196,6 +196,8 @@ rm -rf %{buildroot}%{leapp_python_sitelib}/leapp/cli/commands/tests @@ -997,7 +1008,7 @@ index af4b31d..0d8f6c8 100644 # remove component/unit tests, Makefiles, ... stuff that related to testing only diff --git a/repos/system_upgrade/cloudlinux/.leapp/info b/repos/system_upgrade/cloudlinux/.leapp/info new file mode 100644 -index 0000000..1f16b9f +index 00000000..1f16b9fa --- /dev/null +++ b/repos/system_upgrade/cloudlinux/.leapp/info @@ -0,0 +1 @@ @@ -1005,7 +1016,7 @@ index 0000000..1f16b9f \ No newline at end of file diff --git a/repos/system_upgrade/cloudlinux/.leapp/leapp.conf b/repos/system_upgrade/cloudlinux/.leapp/leapp.conf new file mode 100644 -index 0000000..b459134 +index 00000000..b4591347 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/.leapp/leapp.conf @@ -0,0 +1,6 @@ @@ -1017,7 +1028,7 @@ index 0000000..b459134 +path=${repository:state_dir}/leapp.db diff --git a/repos/system_upgrade/cloudlinux/actors/addcustomrepositories/actor.py b/repos/system_upgrade/cloudlinux/actors/addcustomrepositories/actor.py new file mode 100644 -index 0000000..783e347 +index 00000000..783e3473 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/addcustomrepositories/actor.py @@ -0,0 +1,21 @@ @@ -1044,7 +1055,7 @@ index 0000000..783e347 + add_custom(self.log) diff --git a/repos/system_upgrade/cloudlinux/actors/addcustomrepositories/libraries/addcustomrepositories.py b/repos/system_upgrade/cloudlinux/actors/addcustomrepositories/libraries/addcustomrepositories.py new file mode 100644 -index 0000000..74ba425 +index 00000000..74ba425f --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/addcustomrepositories/libraries/addcustomrepositories.py @@ -0,0 +1,26 @@ @@ -1076,7 +1087,7 @@ index 0000000..74ba425 + shutil.copy(full_repo_path, REPO_ROOT_PATH) diff --git a/repos/system_upgrade/cloudlinux/actors/backupmysqldata/actor.py b/repos/system_upgrade/cloudlinux/actors/backupmysqldata/actor.py new file mode 100644 -index 0000000..8e0f0e2 +index 00000000..8e0f0e2c --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/backupmysqldata/actor.py @@ -0,0 +1,22 @@ @@ -1104,7 +1115,7 @@ index 0000000..8e0f0e2 + backup_file(filename, os.path.basename(filename)) diff --git a/repos/system_upgrade/cloudlinux/actors/checkcllicense/actor.py b/repos/system_upgrade/cloudlinux/actors/checkcllicense/actor.py new file mode 100644 -index 0000000..7934a9c +index 00000000..7934a9c4 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkcllicense/actor.py @@ -0,0 +1,42 @@ @@ -1152,7 +1163,7 @@ index 0000000..7934a9c + ]) diff --git a/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/actor.py b/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/actor.py new file mode 100644 -index 0000000..1b1ffbc +index 00000000..1b1ffbcf --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/actor.py @@ -0,0 +1,20 @@ @@ -1178,7 +1189,7 @@ index 0000000..1b1ffbc + checkpanelmemory.process() diff --git a/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/libraries/checkpanelmemory.py b/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/libraries/checkpanelmemory.py new file mode 100644 -index 0000000..81c6566 +index 00000000..81c65667 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/libraries/checkpanelmemory.py @@ -0,0 +1,57 @@ @@ -1241,7 +1252,7 @@ index 0000000..81c6566 + ) diff --git a/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/tests/test_checkpanelmemory.py b/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/tests/test_checkpanelmemory.py new file mode 100644 -index 0000000..7a3c0be +index 00000000..7a3c0bec --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkpanelmemory/tests/test_checkpanelmemory.py @@ -0,0 +1,42 @@ @@ -1289,7 +1300,7 @@ index 0000000..7a3c0be + assert reporting.Flags.INHIBITOR in reporting.create_report.report_fields["flags"] diff --git a/repos/system_upgrade/cloudlinux/actors/checkrhnclienttools/actor.py b/repos/system_upgrade/cloudlinux/actors/checkrhnclienttools/actor.py new file mode 100644 -index 0000000..a1c1cee +index 00000000..a1c1ceef --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkrhnclienttools/actor.py @@ -0,0 +1,58 @@ @@ -1353,7 +1364,7 @@ index 0000000..a1c1cee + ]) diff --git a/repos/system_upgrade/cloudlinux/actors/checkrhnclienttools/libraries/version.py b/repos/system_upgrade/cloudlinux/actors/checkrhnclienttools/libraries/version.py new file mode 100644 -index 0000000..149bce2 +index 00000000..149bce23 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkrhnclienttools/libraries/version.py @@ -0,0 +1,46 @@ @@ -1405,7 +1416,7 @@ index 0000000..149bce2 + diff --git a/repos/system_upgrade/cloudlinux/actors/checkrhnversionoverride/actor.py b/repos/system_upgrade/cloudlinux/actors/checkrhnversionoverride/actor.py new file mode 100644 -index 0000000..2321bde +index 00000000..2321bde0 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkrhnversionoverride/actor.py @@ -0,0 +1,39 @@ @@ -1450,7 +1461,7 @@ index 0000000..2321bde + ]) diff --git a/repos/system_upgrade/cloudlinux/actors/checkup2dateconfig/actor.py b/repos/system_upgrade/cloudlinux/actors/checkup2dateconfig/actor.py new file mode 100644 -index 0000000..bfc0642 +index 00000000..bfc06421 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/checkup2dateconfig/actor.py @@ -0,0 +1,48 @@ @@ -1504,7 +1515,7 @@ index 0000000..bfc0642 + self.log.info('"%s" config deleted', self.new) diff --git a/repos/system_upgrade/cloudlinux/actors/clearpackageconflicts/actor.py b/repos/system_upgrade/cloudlinux/actors/clearpackageconflicts/actor.py new file mode 100644 -index 0000000..cd6801b +index 00000000..cd6801b2 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/clearpackageconflicts/actor.py @@ -0,0 +1,36 @@ @@ -1546,7 +1557,7 @@ index 0000000..cd6801b + raise diff --git a/repos/system_upgrade/cloudlinux/actors/clmysqlrepositorysetup/actor.py b/repos/system_upgrade/cloudlinux/actors/clmysqlrepositorysetup/actor.py new file mode 100644 -index 0000000..4651580 +index 00000000..4651580a --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/clmysqlrepositorysetup/actor.py @@ -0,0 +1,35 @@ @@ -1587,7 +1598,7 @@ index 0000000..4651580 + clmysqlrepositorysetup.process() diff --git a/repos/system_upgrade/cloudlinux/actors/clmysqlrepositorysetup/libraries/clmysqlrepositorysetup.py b/repos/system_upgrade/cloudlinux/actors/clmysqlrepositorysetup/libraries/clmysqlrepositorysetup.py new file mode 100644 -index 0000000..901bf6a +index 00000000..901bf6a5 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/clmysqlrepositorysetup/libraries/clmysqlrepositorysetup.py @@ -0,0 +1,241 @@ @@ -1834,7 +1845,7 @@ index 0000000..901bf6a + )) diff --git a/repos/system_upgrade/cloudlinux/actors/detectcontrolpanel/actor.py b/repos/system_upgrade/cloudlinux/actors/detectcontrolpanel/actor.py new file mode 100644 -index 0000000..75904d9 +index 00000000..75904d9f --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/detectcontrolpanel/actor.py @@ -0,0 +1,54 @@ @@ -1894,7 +1905,7 @@ index 0000000..75904d9 + ) diff --git a/repos/system_upgrade/cloudlinux/actors/enableyumspacewalkplugin/actor.py b/repos/system_upgrade/cloudlinux/actors/enableyumspacewalkplugin/actor.py new file mode 100644 -index 0000000..95fcce9 +index 00000000..95fcce9d --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/enableyumspacewalkplugin/actor.py @@ -0,0 +1,56 @@ @@ -1956,7 +1967,7 @@ index 0000000..95fcce9 + ]) diff --git a/repos/system_upgrade/cloudlinux/actors/registerpackageworkarounds/actor.py b/repos/system_upgrade/cloudlinux/actors/registerpackageworkarounds/actor.py new file mode 100644 -index 0000000..e946c2b +index 00000000..e946c2ba --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/registerpackageworkarounds/actor.py @@ -0,0 +1,21 @@ @@ -1983,7 +1994,7 @@ index 0000000..e946c2b + registerpackageworkarounds.process() diff --git a/repos/system_upgrade/cloudlinux/actors/registerpackageworkarounds/libraries/registerpackageworkarounds.py b/repos/system_upgrade/cloudlinux/actors/registerpackageworkarounds/libraries/registerpackageworkarounds.py new file mode 100644 -index 0000000..c11a65c +index 00000000..c11a65c7 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/registerpackageworkarounds/libraries/registerpackageworkarounds.py @@ -0,0 +1,45 @@ @@ -2034,7 +2045,7 @@ index 0000000..c11a65c + ) diff --git a/repos/system_upgrade/cloudlinux/actors/replacerpmnewconfigs/actor.py b/repos/system_upgrade/cloudlinux/actors/replacerpmnewconfigs/actor.py new file mode 100644 -index 0000000..56cce4f +index 00000000..56cce4f4 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/replacerpmnewconfigs/actor.py @@ -0,0 +1,81 @@ @@ -2121,7 +2132,7 @@ index 0000000..56cce4f + ]) diff --git a/repos/system_upgrade/cloudlinux/actors/resetrhnversionoverride/actor.py b/repos/system_upgrade/cloudlinux/actors/resetrhnversionoverride/actor.py new file mode 100644 -index 0000000..21b2164 +index 00000000..21b2164c --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/resetrhnversionoverride/actor.py @@ -0,0 +1,25 @@ @@ -2152,7 +2163,7 @@ index 0000000..21b2164 + f.writelines(config_data) diff --git a/repos/system_upgrade/cloudlinux/actors/restoremysqldata/actor.py b/repos/system_upgrade/cloudlinux/actors/restoremysqldata/actor.py new file mode 100644 -index 0000000..8e27d99 +index 00000000..8e27d999 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/restoremysqldata/actor.py @@ -0,0 +1,46 @@ @@ -2204,7 +2215,7 @@ index 0000000..8e27d99 + ) diff --git a/repos/system_upgrade/cloudlinux/actors/restorerepositoryconfigurations/actor.py b/repos/system_upgrade/cloudlinux/actors/restorerepositoryconfigurations/actor.py new file mode 100644 -index 0000000..5b90c59 +index 00000000..5b90c59f --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/restorerepositoryconfigurations/actor.py @@ -0,0 +1,46 @@ @@ -2256,7 +2267,7 @@ index 0000000..5b90c59 + dnfconfig.disable_repository(cmd_context, repo_data.repoid) diff --git a/repos/system_upgrade/cloudlinux/actors/scancontrolpanel/actor.py b/repos/system_upgrade/cloudlinux/actors/scancontrolpanel/actor.py new file mode 100644 -index 0000000..96524ed +index 00000000..96524edf --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scancontrolpanel/actor.py @@ -0,0 +1,27 @@ @@ -2289,7 +2300,7 @@ index 0000000..96524ed + ) diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/actor.py b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/actor.py new file mode 100644 -index 0000000..202e5f7 +index 00000000..202e5f72 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/actor.py @@ -0,0 +1,30 @@ @@ -2325,7 +2336,7 @@ index 0000000..202e5f7 + scanrolloutrepositories.process() diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/libraries/scanrolloutrepositories.py b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/libraries/scanrolloutrepositories.py new file mode 100644 -index 0000000..f941a1d +index 00000000..f941a1d0 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/libraries/scanrolloutrepositories.py @@ -0,0 +1,69 @@ @@ -2400,7 +2411,7 @@ index 0000000..f941a1d + process_repofile(repofile, used_list) diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/cloudlinux-rollout.repo b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/cloudlinux-rollout.repo new file mode 100644 -index 0000000..1951053 +index 00000000..1951053e --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/cloudlinux-rollout.repo @@ -0,0 +1,512 @@ @@ -2918,7 +2929,7 @@ index 0000000..1951053 +skip_if_unavailable=True diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/imunify-new-rollout.repo b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/imunify-new-rollout.repo new file mode 100644 -index 0000000..674802b +index 00000000..674802b3 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/imunify-new-rollout.repo @@ -0,0 +1,63 @@ @@ -2988,7 +2999,7 @@ index 0000000..674802b \ No newline at end of file diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/imunify-rollout.repo b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/imunify-rollout.repo new file mode 100644 -index 0000000..6308a41 +index 00000000..6308a41d --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/after/imunify-rollout.repo @@ -0,0 +1,63 @@ @@ -3058,7 +3069,7 @@ index 0000000..6308a41 \ No newline at end of file diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/cloudlinux-rollout.repo b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/cloudlinux-rollout.repo new file mode 100644 -index 0000000..e058414 +index 00000000..e0584145 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/cloudlinux-rollout.repo @@ -0,0 +1,512 @@ @@ -3576,7 +3587,7 @@ index 0000000..e058414 +skip_if_unavailable=True diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/imunify-new-rollout.repo b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/imunify-new-rollout.repo new file mode 100644 -index 0000000..585acd5 +index 00000000..585acd52 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/imunify-new-rollout.repo @@ -0,0 +1,63 @@ @@ -3646,7 +3657,7 @@ index 0000000..585acd5 \ No newline at end of file diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/imunify-rollout.repo b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/imunify-rollout.repo new file mode 100644 -index 0000000..dfe6e40 +index 00000000..dfe6e406 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/files/before/imunify-rollout.repo @@ -0,0 +1,63 @@ @@ -3716,7 +3727,7 @@ index 0000000..dfe6e40 \ No newline at end of file diff --git a/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/test_releasever_replace.py b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/test_releasever_replace.py new file mode 100644 -index 0000000..5bcb9cf +index 00000000..5bcb9cfc --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/scanrolloutrepositories/tests/test_releasever_replace.py @@ -0,0 +1,52 @@ @@ -3775,7 +3786,7 @@ index 0000000..5bcb9cf \ No newline at end of file diff --git a/repos/system_upgrade/cloudlinux/actors/switchclnchannel/actor.py b/repos/system_upgrade/cloudlinux/actors/switchclnchannel/actor.py new file mode 100644 -index 0000000..79eb3e4 +index 00000000..79eb3e49 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/switchclnchannel/actor.py @@ -0,0 +1,59 @@ @@ -3840,7 +3851,7 @@ index 0000000..79eb3e4 + ) diff --git a/repos/system_upgrade/cloudlinux/actors/updatecagefs/actor.py b/repos/system_upgrade/cloudlinux/actors/updatecagefs/actor.py new file mode 100644 -index 0000000..c6590d2 +index 00000000..c6590d29 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/actors/updatecagefs/actor.py @@ -0,0 +1,37 @@ @@ -3883,7 +3894,7 @@ index 0000000..c6590d2 + ) diff --git a/repos/system_upgrade/cloudlinux/libraries/backup.py b/repos/system_upgrade/cloudlinux/libraries/backup.py new file mode 100644 -index 0000000..9002f56 +index 00000000..9002f569 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/libraries/backup.py @@ -0,0 +1,49 @@ @@ -3938,7 +3949,7 @@ index 0000000..9002f56 + shutil.copy(src_path, destination) diff --git a/repos/system_upgrade/cloudlinux/libraries/cl_repofileutils.py b/repos/system_upgrade/cloudlinux/libraries/cl_repofileutils.py new file mode 100644 -index 0000000..eb274f5 +index 00000000..eb274f53 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/libraries/cl_repofileutils.py @@ -0,0 +1,35 @@ @@ -3979,7 +3990,7 @@ index 0000000..eb274f5 + return leapp_repo_path diff --git a/repos/system_upgrade/cloudlinux/libraries/cllaunch.py b/repos/system_upgrade/cloudlinux/libraries/cllaunch.py new file mode 100644 -index 0000000..6cbab5d +index 00000000..6cbab5de --- /dev/null +++ b/repos/system_upgrade/cloudlinux/libraries/cllaunch.py @@ -0,0 +1,11 @@ @@ -3996,7 +4007,7 @@ index 0000000..6cbab5d + return wrapper diff --git a/repos/system_upgrade/cloudlinux/libraries/clmysql.py b/repos/system_upgrade/cloudlinux/libraries/clmysql.py new file mode 100644 -index 0000000..f04f6c5 +index 00000000..f04f6c53 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/libraries/clmysql.py @@ -0,0 +1,43 @@ @@ -4045,7 +4056,7 @@ index 0000000..f04f6c5 + return None diff --git a/repos/system_upgrade/cloudlinux/libraries/detectcontrolpanel.py b/repos/system_upgrade/cloudlinux/libraries/detectcontrolpanel.py new file mode 100644 -index 0000000..7c92f10 +index 00000000..7c92f102 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/libraries/detectcontrolpanel.py @@ -0,0 +1,69 @@ @@ -4120,7 +4131,7 @@ index 0000000..7c92f10 + return panel_name diff --git a/repos/system_upgrade/cloudlinux/models/installedcontrolpanel.py b/repos/system_upgrade/cloudlinux/models/installedcontrolpanel.py new file mode 100644 -index 0000000..ace1e15 +index 00000000..ace1e15e --- /dev/null +++ b/repos/system_upgrade/cloudlinux/models/installedcontrolpanel.py @@ -0,0 +1,12 @@ @@ -4138,7 +4149,7 @@ index 0000000..ace1e15 + name = fields.String() diff --git a/repos/system_upgrade/cloudlinux/models/installedmysqltype.py b/repos/system_upgrade/cloudlinux/models/installedmysqltype.py new file mode 100644 -index 0000000..5cc475d +index 00000000..5cc475d9 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/models/installedmysqltype.py @@ -0,0 +1,12 @@ @@ -4156,7 +4167,7 @@ index 0000000..5cc475d + version = fields.Nullable(fields.String(default=None)) # used for cl-mysql diff --git a/repos/system_upgrade/cloudlinux/tools/remove-problem-packages b/repos/system_upgrade/cloudlinux/tools/remove-problem-packages new file mode 100755 -index 0000000..ed8c523 +index 00000000..ed8c5230 --- /dev/null +++ b/repos/system_upgrade/cloudlinux/tools/remove-problem-packages @@ -0,0 +1,6 @@ @@ -4167,7 +4178,7 @@ index 0000000..ed8c523 +# can be removed normally +yum -y remove alt-ruby31-rubygem-rack alt-ruby31-rubygem-rackup diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py -index a2cede0..5ff1c76 100644 +index a2cede0a..5ff1c76a 100644 --- a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py +++ b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py @@ -17,7 +17,7 @@ def add_boot_entry(configs=None): @@ -4180,7 +4191,7 @@ index a2cede0..5ff1c76 100644 '--make-default', '--args', '{DEBUG} enforcing=0 rd.plymouth=0 plymouth.enable=0'.format(DEBUG=debug) diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py -index bb89c9f..2b8e7c8 100644 +index bb89c9f9..2b8e7c82 100644 --- a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py +++ b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py @@ -42,7 +42,7 @@ run_args_add = [ @@ -4194,7 +4205,7 @@ index bb89c9f..2b8e7c8 100644 '--args', diff --git a/repos/system_upgrade/common/actors/checkenabledvendorrepos/actor.py b/repos/system_upgrade/common/actors/checkenabledvendorrepos/actor.py new file mode 100644 -index 0000000..52f5af9 +index 00000000..52f5af9d --- /dev/null +++ b/repos/system_upgrade/common/actors/checkenabledvendorrepos/actor.py @@ -0,0 +1,53 @@ @@ -4252,7 +4263,7 @@ index 0000000..52f5af9 + else: + self.log.info("No active vendors found, vendor list not generated") diff --git a/repos/system_upgrade/common/actors/checketcreleasever/libraries/checketcreleasever.py b/repos/system_upgrade/common/actors/checketcreleasever/libraries/checketcreleasever.py -index ed5089e..8cf4b75 100644 +index ed5089ed..8cf4b75e 100644 --- a/repos/system_upgrade/common/actors/checketcreleasever/libraries/checketcreleasever.py +++ b/repos/system_upgrade/common/actors/checketcreleasever/libraries/checketcreleasever.py @@ -1,22 +1,21 @@ @@ -4283,7 +4294,7 @@ index ed5089e..8cf4b75 100644 ) ), diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh -index acdb93b..da1e814 100755 +index acdb93ba..da1e814f 100755 --- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh +++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh @@ -8,7 +8,7 @@ fi @@ -4301,7 +4312,7 @@ index acdb93b..da1e814 100755 exit $result - diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-system-upgrade-generator b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-system-upgrade-generator -index 14bd6e3..f6adacf 100755 +index 14bd6e3f..f6adacf7 100755 --- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-system-upgrade-generator +++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-system-upgrade-generator @@ -1,7 +1,7 @@ @@ -4315,7 +4326,7 @@ index 14bd6e3..f6adacf 100755 # stability, but check is better than broken system. diff --git a/repos/system_upgrade/common/actors/detectwebservers/actor.py b/repos/system_upgrade/common/actors/detectwebservers/actor.py new file mode 100644 -index 0000000..ac79714 +index 00000000..ac797141 --- /dev/null +++ b/repos/system_upgrade/common/actors/detectwebservers/actor.py @@ -0,0 +1,53 @@ @@ -4374,7 +4385,7 @@ index 0000000..ac79714 + ) diff --git a/repos/system_upgrade/common/actors/detectwebservers/libraries/detectwebservers.py b/repos/system_upgrade/common/actors/detectwebservers/libraries/detectwebservers.py new file mode 100644 -index 0000000..e0058e6 +index 00000000..e0058e6d --- /dev/null +++ b/repos/system_upgrade/common/actors/detectwebservers/libraries/detectwebservers.py @@ -0,0 +1,42 @@ @@ -4421,7 +4432,7 @@ index 0000000..e0058e6 + """ + return os.path.isfile(NGINX_BINARY) diff --git a/repos/system_upgrade/common/actors/efibootorderfix/finalization/actor.py b/repos/system_upgrade/common/actors/efibootorderfix/finalization/actor.py -index f42909f..2728cb4 100644 +index f42909f0..2728cb4c 100644 --- a/repos/system_upgrade/common/actors/efibootorderfix/finalization/actor.py +++ b/repos/system_upgrade/common/actors/efibootorderfix/finalization/actor.py @@ -1,17 +1,102 @@ @@ -4532,7 +4543,7 @@ index f42909f..2728cb4 100644 + if not has_grub_cfg: + run(['/sbin/grub2-mkconfig', '-o', grub_cfg_path]) diff --git a/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py b/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py -index e0d89d9..8fc5954 100644 +index e0d89d9f..8fc5954c 100644 --- a/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py +++ b/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py @@ -3,7 +3,8 @@ from leapp.models import ( @@ -4609,7 +4620,7 @@ index e0d89d9..8fc5954 100644 modules_to_reset=list(modules_to_reset.values()), modules_to_enable=list(modules_to_enable.values()))) diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/files/generate-initram.sh b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/files/generate-initram.sh -index 3e904f6..9b717a8 100755 +index 3e904f62..9b717a8d 100755 --- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/files/generate-initram.sh +++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/files/generate-initram.sh @@ -7,7 +7,7 @@ stage() { @@ -4622,7 +4633,7 @@ index 3e904f6..9b717a8 100755 dracut_install_modules() diff --git a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py -index edf978f..7fea4ec 100644 +index edf978f6..7fea4ece 100644 --- a/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py +++ b/repos/system_upgrade/common/actors/ipuworkflowconfig/libraries/ipuworkflowconfig.py @@ -47,6 +47,7 @@ def get_os_release(path): @@ -4643,7 +4654,7 @@ index edf978f..7fea4ec 100644 variant_id=data.get('VARIANT_ID', '').strip('"') or None ) diff --git a/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py b/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py -index 134d1aa..c4d9931 100644 +index 134d1aad..c4d99317 100644 --- a/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py +++ b/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py @@ -125,7 +125,12 @@ def process(): @@ -4660,8 +4671,69 @@ index 134d1aa..c4d9931 100644 title = 'Newest installed kernel not in use' summary = ('To ensure a stable upgrade, the machine needs to be' ' booted into the latest installed kernel.') +diff --git a/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py b/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py +index 146f1a33..eb063abb 100644 +--- a/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py ++++ b/repos/system_upgrade/common/actors/pcidevicesscanner/libraries/pcidevicesscanner.py +@@ -1,7 +1,13 @@ + import re + + from leapp.libraries.stdlib import api, run +-from leapp.models import DetectedDeviceOrDriver, DeviceDriverDeprecationData, PCIDevice, PCIDevices ++from leapp.models import ( ++ ActiveKernelModulesFacts, ++ DetectedDeviceOrDriver, ++ DeviceDriverDeprecationData, ++ PCIDevice, ++ PCIDevices ++) + + # Regex to capture Vendor, Device and SVendor and SDevice values + PCI_ID_REG = re.compile(r"(?<=Vendor:\t|Device:\t)\w+") +@@ -72,7 +78,7 @@ def parse_pci_devices(pci_textual, pci_numeric): + def produce_detected_devices(devices): + prefix_re = re.compile('0x') + entry_lookup = { +- prefix_re.sub(' ', entry.device_id): entry ++ prefix_re.sub('', entry.device_id): entry + for message in api.consume(DeviceDriverDeprecationData) for entry in message.entries + } + api.produce(*[ +@@ -82,6 +88,26 @@ def produce_detected_devices(devices): + ]) + + ++def produce_detected_drivers(devices): ++ active_modules = { ++ module.file_name ++ for message in api.consume(ActiveKernelModulesFacts) for module in message.kernel_modules ++ } ++ ++ # Create a lookup by driver_name and filter out the kernel that are active ++ entry_lookup = { ++ entry.driver_name: entry ++ for message in api.consume(DeviceDriverDeprecationData) for entry in message.entries ++ if not entry.device_id and entry.driver_name and entry.driver_name not in active_modules ++ } ++ ++ drivers = {device.driver for device in devices if device.driver in entry_lookup} ++ api.produce(*[ ++ DetectedDeviceOrDriver(**entry_lookup[driver].dump()) ++ for driver in drivers ++ ]) ++ ++ + def produce_pci_devices(producer, devices): + """ Produce a Leapp message with all PCI devices """ + producer(PCIDevices(devices=devices)) +@@ -93,4 +119,5 @@ def scan_pci_devices(producer): + pci_numeric = run(['lspci', '-vmmkn'], checked=False)['stdout'] + devices = parse_pci_devices(pci_textual, pci_numeric) + produce_detected_devices(devices) ++ produce_detected_drivers(devices) + produce_pci_devices(producer, devices) diff --git a/repos/system_upgrade/common/actors/peseventsscanner/actor.py b/repos/system_upgrade/common/actors/peseventsscanner/actor.py -index fadf76b..7ef2664 100644 +index fadf76b0..7ef2664d 100644 --- a/repos/system_upgrade/common/actors/peseventsscanner/actor.py +++ b/repos/system_upgrade/common/actors/peseventsscanner/actor.py @@ -1,3 +1,6 @@ @@ -4713,7 +4785,7 @@ index fadf76b..7ef2664 100644 + if pesfile[:-len(pes_json_suffix)] in active_vendors: + pes_events_scanner(VENDORS_DIR, pesfile) diff --git a/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner.py b/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner.py -index 1be2caa..aca8a72 100644 +index 1be2caa1..aca8a725 100644 --- a/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner.py +++ b/repos/system_upgrade/common/actors/peseventsscanner/libraries/peseventsscanner.py @@ -59,12 +59,14 @@ class Action(IntEnum): @@ -4915,7 +4987,7 @@ index 1be2caa..aca8a72 100644 modules_to_reset=modules_to_reset)) diff --git a/repos/system_upgrade/common/actors/peseventsscanner/tests/unit_test_peseventsscanner.py b/repos/system_upgrade/common/actors/peseventsscanner/tests/unit_test_peseventsscanner.py -index f4b02e9..c22165e 100644 +index f4b02e9f..c22165e5 100644 --- a/repos/system_upgrade/common/actors/peseventsscanner/tests/unit_test_peseventsscanner.py +++ b/repos/system_upgrade/common/actors/peseventsscanner/tests/unit_test_peseventsscanner.py @@ -492,6 +492,10 @@ def test_get_events(monkeypatch): @@ -4930,7 +5002,7 @@ index f4b02e9..c22165e 100644 def test_pes_data_not_found(monkeypatch): def read_or_fetch_mocked(filename, directory="/etc/leapp/files", service=None, allow_empty=False): diff --git a/repos/system_upgrade/common/actors/redhatsignedrpmscanner/actor.py b/repos/system_upgrade/common/actors/redhatsignedrpmscanner/actor.py -index 01f6df3..8464970 100644 +index 01f6df38..84649709 100644 --- a/repos/system_upgrade/common/actors/redhatsignedrpmscanner/actor.py +++ b/repos/system_upgrade/common/actors/redhatsignedrpmscanner/actor.py @@ -1,27 +1,69 @@ @@ -5093,7 +5165,7 @@ index 01f6df3..8464970 100644 self.produce(unsigned_pkgs) diff --git a/repos/system_upgrade/common/actors/removeobsoletegpgkeys/actor.py b/repos/system_upgrade/common/actors/removeobsoletegpgkeys/actor.py new file mode 100644 -index 0000000..5674ee3 +index 00000000..5674ee3f --- /dev/null +++ b/repos/system_upgrade/common/actors/removeobsoletegpgkeys/actor.py @@ -0,0 +1,24 @@ @@ -5123,7 +5195,7 @@ index 0000000..5674ee3 + removeobsoleterpmgpgkeys.process() diff --git a/repos/system_upgrade/common/actors/removeobsoletegpgkeys/libraries/removeobsoleterpmgpgkeys.py b/repos/system_upgrade/common/actors/removeobsoletegpgkeys/libraries/removeobsoleterpmgpgkeys.py new file mode 100644 -index 0000000..11c61e3 +index 00000000..11c61e36 --- /dev/null +++ b/repos/system_upgrade/common/actors/removeobsoletegpgkeys/libraries/removeobsoleterpmgpgkeys.py @@ -0,0 +1,51 @@ @@ -5180,7 +5252,7 @@ index 0000000..11c61e3 + register_dnfworkaround(keys) diff --git a/repos/system_upgrade/common/actors/removeobsoletegpgkeys/tests/test_removeobsoleterpmgpgkeys.py b/repos/system_upgrade/common/actors/removeobsoletegpgkeys/tests/test_removeobsoleterpmgpgkeys.py new file mode 100644 -index 0000000..1d48781 +index 00000000..1d487815 --- /dev/null +++ b/repos/system_upgrade/common/actors/removeobsoletegpgkeys/tests/test_removeobsoleterpmgpgkeys.py @@ -0,0 +1,94 @@ @@ -5279,7 +5351,7 @@ index 0000000..1d48781 + removeobsoleterpmgpgkeys.process() + assert api.produce.called == should_register diff --git a/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py b/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py -index b2d00f3..e9458c5 100644 +index b2d00f3e..e9458c5f 100644 --- a/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py +++ b/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py @@ -1,12 +1,9 @@ @@ -5459,7 +5531,7 @@ index b2d00f3..e9458c5 100644 - _inhibit_upgrade('The repository mapping file is invalid: {}'.format(err)) + inhibit_upgrade('The repository mapping file is invalid: {}'.format(err)) diff --git a/repos/system_upgrade/common/actors/repositoriesmapping/tests/unit_test_repositoriesmapping.py b/repos/system_upgrade/common/actors/repositoriesmapping/tests/unit_test_repositoriesmapping.py -index 3c0b04b..3480432 100644 +index 3c0b04b5..3480432b 100644 --- a/repos/system_upgrade/common/actors/repositoriesmapping/tests/unit_test_repositoriesmapping.py +++ b/repos/system_upgrade/common/actors/repositoriesmapping/tests/unit_test_repositoriesmapping.py @@ -15,7 +15,6 @@ from leapp.models import PESIDRepositoryEntry @@ -5471,7 +5543,7 @@ index 3c0b04b..3480432 100644 def adjust_cwd(): previous_cwd = os.getcwd() diff --git a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py -index 05797f5..e6f7803 100644 +index 05797f53..e6f78037 100644 --- a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py +++ b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py @@ -18,21 +18,37 @@ def load_tasks_file(path, logger): @@ -5519,7 +5591,7 @@ index 05797f5..e6f7803 100644 to_keep=load_tasks_file(os.path.join(base_dir, 'to_keep'), logger), to_remove=load_tasks_file(os.path.join(base_dir, 'to_remove'), logger)) diff --git a/repos/system_upgrade/common/actors/scancustomrepofile/actor.py b/repos/system_upgrade/common/actors/scancustomrepofile/actor.py -index d46018f..bb49b4e 100644 +index d46018fa..bb49b4e5 100644 --- a/repos/system_upgrade/common/actors/scancustomrepofile/actor.py +++ b/repos/system_upgrade/common/actors/scancustomrepofile/actor.py @@ -1,6 +1,9 @@ @@ -5543,7 +5615,7 @@ index d46018f..bb49b4e 100644 produces = (CustomTargetRepository, CustomTargetRepositoryFile) tags = (FactsPhaseTag, IPUWorkflowTag) diff --git a/repos/system_upgrade/common/actors/scancustomrepofile/libraries/scancustomrepofile.py b/repos/system_upgrade/common/actors/scancustomrepofile/libraries/scancustomrepofile.py -index c294193..c0820eb 100644 +index c294193d..c0820eb1 100644 --- a/repos/system_upgrade/common/actors/scancustomrepofile/libraries/scancustomrepofile.py +++ b/repos/system_upgrade/common/actors/scancustomrepofile/libraries/scancustomrepofile.py @@ -18,18 +18,27 @@ def process(): @@ -5584,7 +5656,7 @@ index c294193..c0820eb 100644 + "The {} file exists, custom repositories loaded.".format(CUSTOM_REPO_PATH) + ) diff --git a/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py b/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py -index 4ea33a2..aaec273 100644 +index 4ea33a26..aaec2733 100644 --- a/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py +++ b/repos/system_upgrade/common/actors/scancustomrepofile/tests/test_scancustomrepofile.py @@ -4,8 +4,13 @@ from leapp.libraries.actor import scancustomrepofile @@ -5621,7 +5693,7 @@ index 4ea33a2..aaec273 100644 assert not api.produce.called diff --git a/repos/system_upgrade/common/actors/scanvendorrepofiles/actor.py b/repos/system_upgrade/common/actors/scanvendorrepofiles/actor.py new file mode 100644 -index 0000000..dd27b28 +index 00000000..dd27b282 --- /dev/null +++ b/repos/system_upgrade/common/actors/scanvendorrepofiles/actor.py @@ -0,0 +1,27 @@ @@ -5654,7 +5726,7 @@ index 0000000..dd27b28 + scanvendorrepofiles.process() diff --git a/repos/system_upgrade/common/actors/scanvendorrepofiles/libraries/scanvendorrepofiles.py b/repos/system_upgrade/common/actors/scanvendorrepofiles/libraries/scanvendorrepofiles.py new file mode 100644 -index 0000000..ba74be1 +index 00000000..ba74be17 --- /dev/null +++ b/repos/system_upgrade/common/actors/scanvendorrepofiles/libraries/scanvendorrepofiles.py @@ -0,0 +1,72 @@ @@ -5732,7 +5804,7 @@ index 0000000..ba74be1 + ) diff --git a/repos/system_upgrade/common/actors/scanvendorrepofiles/tests/test_scanvendorrepofiles.py b/repos/system_upgrade/common/actors/scanvendorrepofiles/tests/test_scanvendorrepofiles.py new file mode 100644 -index 0000000..cb5c7ab +index 00000000..cb5c7ab7 --- /dev/null +++ b/repos/system_upgrade/common/actors/scanvendorrepofiles/tests/test_scanvendorrepofiles.py @@ -0,0 +1,131 @@ @@ -5868,7 +5940,7 @@ index 0000000..cb5c7ab + assert api.current_logger.infomsg == msg + assert not api.produce.called diff --git a/repos/system_upgrade/common/actors/setetcreleasever/libraries/setetcreleasever.py b/repos/system_upgrade/common/actors/setetcreleasever/libraries/setetcreleasever.py -index 73d1ffd..046f3fb 100644 +index 73d1ffd3..046f3fb4 100644 --- a/repos/system_upgrade/common/actors/setetcreleasever/libraries/setetcreleasever.py +++ b/repos/system_upgrade/common/actors/setetcreleasever/libraries/setetcreleasever.py @@ -1,5 +1,6 @@ @@ -5888,7 +5960,7 @@ index 73d1ffd..046f3fb 100644 pkg_facts = next(api.consume(PkgManagerInfo), None) rhui_facts = next(api.consume(RHUIInfo), None) diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/actor.py b/repos/system_upgrade/common/actors/setuptargetrepos/actor.py -index 00de073..95cedcd 100644 +index 00de0739..95cedcdb 100644 --- a/repos/system_upgrade/common/actors/setuptargetrepos/actor.py +++ b/repos/system_upgrade/common/actors/setuptargetrepos/actor.py @@ -9,9 +9,11 @@ from leapp.models import ( @@ -5915,7 +5987,7 @@ index 00de073..95cedcd 100644 tags = (IPUWorkflowTag, FactsPhaseTag) diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py -index 3f34aed..9c1e360 100644 +index 3f34aedb..9c1e3606 100644 --- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py +++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py @@ -12,7 +12,8 @@ from leapp.models import ( @@ -6031,7 +6103,7 @@ index 3f34aed..9c1e360 100644 for target_pesid, target_pesidrepo in expected_repos.items(): if not target_pesidrepo: diff --git a/repos/system_upgrade/common/actors/systemfacts/actor.py b/repos/system_upgrade/common/actors/systemfacts/actor.py -index 59b12c8..85d4a09 100644 +index 59b12c87..85d4a09e 100644 --- a/repos/system_upgrade/common/actors/systemfacts/actor.py +++ b/repos/system_upgrade/common/actors/systemfacts/actor.py @@ -47,7 +47,7 @@ class SystemFactsActor(Actor): @@ -6043,8 +6115,100 @@ index 59b12c8..85d4a09 100644 def process(self): self.produce(systemfacts.get_sysctls_status()) +diff --git a/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py b/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py +index 0de8b383..81aea6f5 100644 +--- a/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py ++++ b/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py +@@ -9,6 +9,7 @@ import re + import six + + from leapp import reporting ++from leapp.exceptions import StopActorExecutionError + from leapp.libraries.common import repofileutils + from leapp.libraries.common.config import architecture + from leapp.libraries.stdlib import api, CalledProcessError, run +@@ -289,9 +290,25 @@ def _default_grub_info(): + ]) + else: + for line in run(['cat', default_grb_fpath], split=True)['stdout']: +- if not line.strip(): ++ line = line.strip() ++ if not line or line[0] == '#': ++ # skip comments and empty lines + continue +- name, value = tuple(map(type(line).strip, line.split('=', 1))) ++ try: ++ name, value = tuple(map(type(line).strip, line.split('=', 1))) ++ except ValueError as e: ++ # we do not want to really continue when we cannot parse this file ++ # TODO(pstodulk): rewrite this in the form we produce inhibitor ++ # with problematic lines. This is improvement just in comparison ++ # to the original hard crash. ++ raise StopActorExecutionError( ++ 'Failed parsing of {}'.format(default_grb_fpath), ++ details={ ++ 'error': str(e), ++ 'problematic line': str(line) ++ } ++ ) ++ + yield DefaultGrub( + name=name, + value=value +diff --git a/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py +new file mode 100644 +index 00000000..08552771 +--- /dev/null ++++ b/repos/system_upgrade/common/actors/systemfacts/tests/test_systemfacts_grub.py +@@ -0,0 +1,46 @@ ++import os ++ ++from leapp.libraries.actor import systemfacts ++from leapp.models import DefaultGrub ++ ++ ++class RunMocked(object): ++ def __init__(self, cmd_result): ++ self.called = 0 ++ self.cmd_result = cmd_result ++ self.split = False ++ self.cmd = None ++ ++ def __call__(self, cmd, split=False): ++ self.cmd = cmd ++ self.split = split ++ self.called += 1 ++ return self.cmd_result ++ ++ ++def test_default_grub_info_valid(monkeypatch): ++ mocked_run = RunMocked({ ++ 'stdout': [ ++ 'line="whatever else here"', ++ 'newline="whatever"', ++ '# comment here', ++ 'why_not=value', ++ ' # whitespaces around comment ', ++ ' ', ++ ' last=last really' ++ ], ++ }) ++ expected_result = [ ++ DefaultGrub(name='line', value='"whatever else here"'), ++ DefaultGrub(name='newline', value='"whatever"'), ++ DefaultGrub(name='why_not', value='value'), ++ DefaultGrub(name='last', value='last really'), ++ ] ++ monkeypatch.setattr(systemfacts, 'run', mocked_run) ++ monkeypatch.setattr(os.path, 'isfile', lambda dummy: True) ++ for msg in systemfacts._default_grub_info(): ++ expected_msg = expected_result.pop(0) ++ assert msg.name == expected_msg.name ++ assert msg.value == expected_msg.value ++ assert mocked_run.called ++ assert not expected_result diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py -index 7a8bd99..d05aaf9 100644 +index 7a8bd99e..d05aaf9a 100644 --- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py +++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py @@ -225,6 +225,12 @@ def _prep_repository_access(context, target_userspace): @@ -6082,7 +6246,7 @@ index 7a8bd99..d05aaf9 100644 diff --git a/repos/system_upgrade/common/actors/vendorreposignaturescanner/actor.py b/repos/system_upgrade/common/actors/vendorreposignaturescanner/actor.py new file mode 100644 -index 0000000..e28b880 +index 00000000..e28b8809 --- /dev/null +++ b/repos/system_upgrade/common/actors/vendorreposignaturescanner/actor.py @@ -0,0 +1,72 @@ @@ -6160,7 +6324,7 @@ index 0000000..e28b880 + ) diff --git a/repos/system_upgrade/common/actors/vendorrepositoriesmapping/actor.py b/repos/system_upgrade/common/actors/vendorrepositoriesmapping/actor.py new file mode 100644 -index 0000000..1325647 +index 00000000..13256476 --- /dev/null +++ b/repos/system_upgrade/common/actors/vendorrepositoriesmapping/actor.py @@ -0,0 +1,19 @@ @@ -6185,7 +6349,7 @@ index 0000000..1325647 + scan_vendor_repomaps() diff --git a/repos/system_upgrade/common/actors/vendorrepositoriesmapping/libraries/vendorrepositoriesmapping.py b/repos/system_upgrade/common/actors/vendorrepositoriesmapping/libraries/vendorrepositoriesmapping.py new file mode 100644 -index 0000000..32ccf58 +index 00000000..32ccf58d --- /dev/null +++ b/repos/system_upgrade/common/actors/vendorrepositoriesmapping/libraries/vendorrepositoriesmapping.py @@ -0,0 +1,72 @@ @@ -6262,7 +6426,7 @@ index 0000000..32ccf58 + # for repomap in vendor_repomap_collection.maps: + # self.produce(repomap) diff --git a/repos/system_upgrade/common/actors/xfsinfoscanner/libraries/xfsinfoscanner.py b/repos/system_upgrade/common/actors/xfsinfoscanner/libraries/xfsinfoscanner.py -index 9fff656..d5594bf 100644 +index 9fff656e..d5594bf8 100644 --- a/repos/system_upgrade/common/actors/xfsinfoscanner/libraries/xfsinfoscanner.py +++ b/repos/system_upgrade/common/actors/xfsinfoscanner/libraries/xfsinfoscanner.py @@ -1,4 +1,4 @@ @@ -6296,7 +6460,7 @@ index 9fff656..d5594bf 100644 def scan_xfs(): diff --git a/repos/system_upgrade/common/files/rhel_upgrade.py b/repos/system_upgrade/common/files/rhel_upgrade.py -index 62221a7..f5b4c70 100644 +index 62221a75..f5b4c706 100644 --- a/repos/system_upgrade/common/files/rhel_upgrade.py +++ b/repos/system_upgrade/common/files/rhel_upgrade.py @@ -171,6 +171,7 @@ class RhelUpgradeCommand(dnf.cli.Command): @@ -6317,7 +6481,7 @@ index 62221a7..f5b4c70 100644 self.base.distro_sync() diff --git a/repos/system_upgrade/common/libraries/config/version.py b/repos/system_upgrade/common/libraries/config/version.py -index 03f3cd4..e460729 100644 +index 03f3cd42..e4607291 100644 --- a/repos/system_upgrade/common/libraries/config/version.py +++ b/repos/system_upgrade/common/libraries/config/version.py @@ -13,8 +13,8 @@ OP_MAP = { @@ -6332,7 +6496,7 @@ index 03f3cd4..e460729 100644 diff --git a/repos/system_upgrade/common/libraries/dnfconfig.py b/repos/system_upgrade/common/libraries/dnfconfig.py -index 2125f6d..f1dbf70 100644 +index 2125f6dc..f1dbf70c 100644 --- a/repos/system_upgrade/common/libraries/dnfconfig.py +++ b/repos/system_upgrade/common/libraries/dnfconfig.py @@ -114,3 +114,30 @@ def exclude_leapp_rpms(context): @@ -6367,7 +6531,7 @@ index 2125f6d..f1dbf70 100644 + raise + api.current_logger().debug('Repository {} has been {}'.format(repo_id, new_state)) diff --git a/repos/system_upgrade/common/libraries/dnfplugin.py b/repos/system_upgrade/common/libraries/dnfplugin.py -index 4010e9f..f095575 100644 +index 4010e9f3..f0955758 100644 --- a/repos/system_upgrade/common/libraries/dnfplugin.py +++ b/repos/system_upgrade/common/libraries/dnfplugin.py @@ -4,6 +4,8 @@ import json @@ -6423,7 +6587,7 @@ index 4010e9f..f095575 100644 raise StopActorExecutionError( message=('Failed to exceute script to apply transaction workaround {display_name}.' diff --git a/repos/system_upgrade/common/libraries/fetch.py b/repos/system_upgrade/common/libraries/fetch.py -index 1c58148..37313b6 100644 +index 1c581484..37313b6c 100644 --- a/repos/system_upgrade/common/libraries/fetch.py +++ b/repos/system_upgrade/common/libraries/fetch.py @@ -73,7 +73,7 @@ def read_or_fetch(filename, directory="/etc/leapp/files", service=None, allow_em @@ -6436,7 +6600,7 @@ index 1c58148..37313b6 100644 except EnvironmentError: _raise_error(local_path, "File {lp} exists but couldn't be read".format(lp=local_path)) diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py -index 6a2f5aa..51030fd 100644 +index 6a2f5aa1..51030fde 100644 --- a/repos/system_upgrade/common/libraries/overlaygen.py +++ b/repos/system_upgrade/common/libraries/overlaygen.py @@ -14,11 +14,15 @@ OVERLAY_DO_NOT_MOUNT = ('tmpfs', 'devpts', 'sysfs', 'proc', 'cramfs', 'sysv', 'v @@ -6474,7 +6638,7 @@ index 6a2f5aa..51030fd 100644 mount_names = [mount_point.fs_file for mount_point in mount_points] diff --git a/repos/system_upgrade/common/libraries/repofileutils.py b/repos/system_upgrade/common/libraries/repofileutils.py -index a3f111b..26e4d3e 100644 +index a3f111b0..26e4d3e5 100644 --- a/repos/system_upgrade/common/libraries/repofileutils.py +++ b/repos/system_upgrade/common/libraries/repofileutils.py @@ -26,6 +26,18 @@ def _parse_repository(repoid, repo_data): @@ -6520,7 +6684,7 @@ index a3f111b..26e4d3e 100644 Return all directories yum scans for repository files, if they exist. diff --git a/repos/system_upgrade/common/libraries/repomaputils.py b/repos/system_upgrade/common/libraries/repomaputils.py new file mode 100644 -index 0000000..5c41620 +index 00000000..5c416208 --- /dev/null +++ b/repos/system_upgrade/common/libraries/repomaputils.py @@ -0,0 +1,147 @@ @@ -6672,7 +6836,7 @@ index 0000000..5c41620 + ) + return repomap diff --git a/repos/system_upgrade/common/libraries/rhsm.py b/repos/system_upgrade/common/libraries/rhsm.py -index b7e4b21..dc038bf 100644 +index b7e4b21f..dc038bf3 100644 --- a/repos/system_upgrade/common/libraries/rhsm.py +++ b/repos/system_upgrade/common/libraries/rhsm.py @@ -92,7 +92,7 @@ def _handle_rhsm_exceptions(hint=None): @@ -6685,7 +6849,7 @@ index b7e4b21..dc038bf 100644 def with_rhsm(f): diff --git a/repos/system_upgrade/common/libraries/rpms.py b/repos/system_upgrade/common/libraries/rpms.py -index 86767c7..18fd63b 100644 +index 86767c7a..18fd63b6 100644 --- a/repos/system_upgrade/common/libraries/rpms.py +++ b/repos/system_upgrade/common/libraries/rpms.py @@ -21,7 +21,10 @@ def get_installed_rpms(): @@ -6766,7 +6930,7 @@ index 86767c7..18fd63b 100644 + if package_name == rpmName: + return {'name': rpmName,'arch': rpmArch, 'version': rpmVersion, 'release': rpmRelease} diff --git a/repos/system_upgrade/common/libraries/utils.py b/repos/system_upgrade/common/libraries/utils.py -index 6793de6..d201677 100644 +index 6793de63..d201677f 100644 --- a/repos/system_upgrade/common/libraries/utils.py +++ b/repos/system_upgrade/common/libraries/utils.py @@ -43,6 +43,14 @@ def parse_config(cfg=None, strict=True): @@ -6786,7 +6950,7 @@ index 6793de6..d201677 100644 diff --git a/repos/system_upgrade/common/models/activevendorlist.py b/repos/system_upgrade/common/models/activevendorlist.py new file mode 100644 -index 0000000..de4056f +index 00000000..de4056fb --- /dev/null +++ b/repos/system_upgrade/common/models/activevendorlist.py @@ -0,0 +1,7 @@ @@ -6798,7 +6962,7 @@ index 0000000..de4056f + topic = VendorTopic + data = fields.List(fields.String()) diff --git a/repos/system_upgrade/common/models/dnfworkaround.py b/repos/system_upgrade/common/models/dnfworkaround.py -index c921c5f..4a813dc 100644 +index c921c5fc..4a813dcd 100644 --- a/repos/system_upgrade/common/models/dnfworkaround.py +++ b/repos/system_upgrade/common/models/dnfworkaround.py @@ -15,6 +15,20 @@ class DNFWorkaround(Model): @@ -6825,7 +6989,7 @@ index c921c5f..4a813dc 100644 + Name to display for this script when executed + """ diff --git a/repos/system_upgrade/common/models/installedrpm.py b/repos/system_upgrade/common/models/installedrpm.py -index 28b0aba..e53ab93 100644 +index 28b0aba1..e53ab938 100644 --- a/repos/system_upgrade/common/models/installedrpm.py +++ b/repos/system_upgrade/common/models/installedrpm.py @@ -27,3 +27,8 @@ class InstalledRedHatSignedRPM(InstalledRPM): @@ -6838,7 +7002,7 @@ index 28b0aba..e53ab93 100644 + # Do we want to install the package again when upgrading? + install = fields.Boolean(default=True) diff --git a/repos/system_upgrade/common/models/repositoriesmap.py b/repos/system_upgrade/common/models/repositoriesmap.py -index c187333..ea6a75d 100644 +index c1873333..ea6a75dc 100644 --- a/repos/system_upgrade/common/models/repositoriesmap.py +++ b/repos/system_upgrade/common/models/repositoriesmap.py @@ -92,3 +92,4 @@ class RepositoriesMapping(Model): @@ -6847,7 +7011,7 @@ index c187333..ea6a75d 100644 repositories = fields.List(fields.Model(PESIDRepositoryEntry), default=[]) + vendor = fields.Nullable(fields.String()) diff --git a/repos/system_upgrade/common/models/rpmtransactiontasks.py b/repos/system_upgrade/common/models/rpmtransactiontasks.py -index 7e2870d..05d4e94 100644 +index 7e2870d0..05d4e941 100644 --- a/repos/system_upgrade/common/models/rpmtransactiontasks.py +++ b/repos/system_upgrade/common/models/rpmtransactiontasks.py @@ -10,6 +10,7 @@ class RpmTransactionTasks(Model): @@ -6859,7 +7023,7 @@ index 7e2870d..05d4e94 100644 modules_to_reset = fields.List(fields.Model(Module), default=[]) diff --git a/repos/system_upgrade/common/models/targetrepositories.py b/repos/system_upgrade/common/models/targetrepositories.py -index 3604772..33f5dc8 100644 +index 3604772c..33f5dc8d 100644 --- a/repos/system_upgrade/common/models/targetrepositories.py +++ b/repos/system_upgrade/common/models/targetrepositories.py @@ -21,6 +21,12 @@ class CustomTargetRepository(TargetRepositoryBase): @@ -6877,7 +7041,7 @@ index 3604772..33f5dc8 100644 rhel_repos = fields.List(fields.Model(RHELTargetRepository)) diff --git a/repos/system_upgrade/common/models/vendorsignatures.py b/repos/system_upgrade/common/models/vendorsignatures.py new file mode 100644 -index 0000000..f456aec +index 00000000..f456aec5 --- /dev/null +++ b/repos/system_upgrade/common/models/vendorsignatures.py @@ -0,0 +1,8 @@ @@ -6891,7 +7055,7 @@ index 0000000..f456aec + sigs = fields.List(fields.String()) diff --git a/repos/system_upgrade/common/models/vendorsourcerepos.py b/repos/system_upgrade/common/models/vendorsourcerepos.py new file mode 100644 -index 0000000..b7a219b +index 00000000..b7a219b4 --- /dev/null +++ b/repos/system_upgrade/common/models/vendorsourcerepos.py @@ -0,0 +1,12 @@ @@ -6909,7 +7073,7 @@ index 0000000..b7a219b + source_repoids = fields.List(fields.String()) diff --git a/repos/system_upgrade/common/tools/removerpmgpgkeys b/repos/system_upgrade/common/tools/removerpmgpgkeys new file mode 100755 -index 0000000..afe1906 +index 00000000..afe19069 --- /dev/null +++ b/repos/system_upgrade/common/tools/removerpmgpgkeys @@ -0,0 +1,13 @@ @@ -6928,7 +7092,7 @@ index 0000000..afe1906 +exit $exit_code diff --git a/repos/system_upgrade/common/topics/vendortopic.py b/repos/system_upgrade/common/topics/vendortopic.py new file mode 100644 -index 0000000..014b7af +index 00000000..014b7afb --- /dev/null +++ b/repos/system_upgrade/common/topics/vendortopic.py @@ -0,0 +1,5 @@ @@ -6938,7 +7102,7 @@ index 0000000..014b7af +class VendorTopic(Topic): + name = 'vendor_topic' diff --git a/repos/system_upgrade/el7toel8/actors/checkleftoverpackages/actor.py b/repos/system_upgrade/el7toel8/actors/checkleftoverpackages/actor.py -index 0c53950..33d7c1f 100644 +index 0c539501..33d7c1f7 100644 --- a/repos/system_upgrade/el7toel8/actors/checkleftoverpackages/actor.py +++ b/repos/system_upgrade/el7toel8/actors/checkleftoverpackages/actor.py @@ -1,8 +1,24 @@ @@ -7035,7 +7199,7 @@ index 0c53950..33d7c1f 100644 self.produce(to_remove) diff --git a/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/actor.py b/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/actor.py -index 69ca0f0..a7d7db1 100644 +index 69ca0f03..a7d7db18 100644 --- a/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/actor.py +++ b/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/actor.py @@ -2,6 +2,7 @@ from leapp.actors import Actor @@ -7076,7 +7240,7 @@ index 69ca0f0..a7d7db1 100644 break diff --git a/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/tools/nm-update-client-ids.py b/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/tools/nm-update-client-ids.py -index 923bf80..9972204 100755 +index 923bf803..9972204f 100755 --- a/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/tools/nm-update-client-ids.py +++ b/repos/system_upgrade/el7toel8/actors/networkmanagerupdateconnections/tools/nm-update-client-ids.py @@ -3,12 +3,26 @@ from __future__ import print_function @@ -7145,7 +7309,7 @@ index 923bf80..9972204 100755 print("{} processed, {} changed, {} errors".format(processed, changed, errors)) diff --git a/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/actor.py b/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/actor.py -index f13a767..2e3412d 100644 +index f13a7672..2e3412dd 100644 --- a/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/actor.py +++ b/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/actor.py @@ -1,7 +1,7 @@ @@ -7225,7 +7389,7 @@ index f13a767..2e3412d 100644 reporting.Severity(reporting.Severity.HIGH), reporting.Tags(COMMON_REPORT_TAGS), diff --git a/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/libraries/opensshpermitrootlogincheck.py b/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/libraries/opensshpermitrootlogincheck.py -index 0cb9081..7a962b7 100644 +index 0cb90819..7a962b7f 100644 --- a/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/libraries/opensshpermitrootlogincheck.py +++ b/repos/system_upgrade/el7toel8/actors/opensshpermitrootlogincheck/libraries/opensshpermitrootlogincheck.py @@ -1,3 +1,5 @@ @@ -7265,9 +7429,73 @@ index 0cb9081..7a962b7 100644 + error = 'Failed to open sshd_config: {}'.format(str(err)) + api.current_logger().error(error) + return +diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py +index eb87cd68..fb83107e 100644 +--- a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py ++++ b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py +@@ -129,6 +129,10 @@ class SatelliteUpgradeFacts(Actor): + modules_to_enable=modules_to_enable + ) + ) +- repositories_to_enable = ['ansible-2.9-for-rhel-8-x86_64-rpms', 'satellite-6.11-for-rhel-8-x86_64-rpms', ++ repositories_to_enable = ['ansible-2.9-for-rhel-8-x86_64-rpms', + 'satellite-maintenance-6.11-for-rhel-8-x86_64-rpms'] ++ if has_package(InstalledRPM, 'foreman'): ++ repositories_to_enable.append('satellite-6.11-for-rhel-8-x86_64-rpms') ++ else: ++ repositories_to_enable.append('satellite-capsule-6.11-for-rhel-8-x86_64-rpms') + self.produce(RepositoriesSetupTasks(to_enable=repositories_to_enable)) +diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py +index 5c8e79ff..e77b7b58 100644 +--- a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py ++++ b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py +@@ -1,6 +1,14 @@ + import os + +-from leapp.models import DNFWorkaround, InstalledRPM, Module, RPM, RpmTransactionTasks, SatelliteFacts ++from leapp.models import ( ++ DNFWorkaround, ++ InstalledRPM, ++ Module, ++ RepositoriesSetupTasks, ++ RPM, ++ RpmTransactionTasks, ++ SatelliteFacts ++) + from leapp.snactor.fixture import current_actor_context + + RH_PACKAGER = 'Red Hat, Inc. ' +@@ -87,3 +95,27 @@ def test_detects_remote_postgresql(current_actor_context): + assert not satellitemsg.postgresql.local_postgresql + + assert not current_actor_context.consume(DNFWorkaround) ++ ++ ++def test_enables_right_repositories_on_satellite(current_actor_context): ++ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM])) ++ current_actor_context.run() ++ ++ rpmmessage = current_actor_context.consume(RepositoriesSetupTasks)[0] ++ ++ assert 'ansible-2.9-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable ++ assert 'satellite-maintenance-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable ++ assert 'satellite-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable ++ assert 'satellite-capsule-6.11-for-rhel-8-x86_64-rpms' not in rpmmessage.to_enable ++ ++ ++def test_enables_right_repositories_on_capsule(current_actor_context): ++ current_actor_context.feed(InstalledRPM(items=[FOREMAN_PROXY_RPM])) ++ current_actor_context.run() ++ ++ rpmmessage = current_actor_context.consume(RepositoriesSetupTasks)[0] ++ ++ assert 'ansible-2.9-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable ++ assert 'satellite-maintenance-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable ++ assert 'satellite-6.11-for-rhel-8-x86_64-rpms' not in rpmmessage.to_enable ++ assert 'satellite-capsule-6.11-for-rhel-8-x86_64-rpms' in rpmmessage.to_enable diff --git a/repos/system_upgrade/el7toel8/actors/updateyumvars/actor.py b/repos/system_upgrade/el7toel8/actors/updateyumvars/actor.py new file mode 100644 -index 0000000..6252fba +index 00000000..6252fba7 --- /dev/null +++ b/repos/system_upgrade/el7toel8/actors/updateyumvars/actor.py @@ -0,0 +1,18 @@ @@ -7291,7 +7519,7 @@ index 0000000..6252fba + updateyumvars.vars_update() diff --git a/repos/system_upgrade/el7toel8/actors/updateyumvars/libraries/updateyumvars.py b/repos/system_upgrade/el7toel8/actors/updateyumvars/libraries/updateyumvars.py new file mode 100644 -index 0000000..b77f784 +index 00000000..b77f7848 --- /dev/null +++ b/repos/system_upgrade/el7toel8/actors/updateyumvars/libraries/updateyumvars.py @@ -0,0 +1,23 @@ @@ -7318,9 +7546,169 @@ index 0000000..b77f784 + with open(varfile_path, 'w') as varfile: + # Overwrite the value from outdated "7". + varfile.write('8') +diff --git a/repos/system_upgrade/el8toel9/actors/migrateblacklistca/actor.py b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/actor.py +new file mode 100644 +index 00000000..863a0063 +--- /dev/null ++++ b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/actor.py +@@ -0,0 +1,28 @@ ++from leapp.actors import Actor ++from leapp.libraries.actor import migrateblacklistca ++from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag ++ ++ ++class MigrateBlacklistCA(Actor): ++ """ ++ Preserve blacklisted certificates during the upgrade ++ ++ Path for the blacklisted certificates has been changed on RHEL 9. ++ The original paths on RHEL 8 and older systems have been: ++ /etc/pki/ca-trust/source/blacklist/ ++ /usr/share/pki/ca-trust-source/blacklist/ ++ However on RHEL 9 the blacklist directory has been renamed to 'blocklist'. ++ So the new paths are: ++ /etc/pki/ca-trust/source/blocklist/ ++ /usr/share/pki/ca-trust-source/blocklist/ ++ This actor moves all blacklisted certificates into the expected directories ++ and fix symlinks if needed. ++ """ ++ ++ name = 'migrate_blacklist_ca' ++ consumes = () ++ produces = () ++ tags = (ApplicationsPhaseTag, IPUWorkflowTag) ++ ++ def process(self): ++ migrateblacklistca.process() +diff --git a/repos/system_upgrade/el8toel9/actors/migrateblacklistca/libraries/migrateblacklistca.py b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/libraries/migrateblacklistca.py +new file mode 100644 +index 00000000..73c9d565 +--- /dev/null ++++ b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/libraries/migrateblacklistca.py +@@ -0,0 +1,89 @@ ++import os ++import shutil ++ ++from leapp.libraries.stdlib import api, CalledProcessError, run ++ ++# dict(orig_dir: new_dir) ++DIRS_CHANGE = { ++ '/etc/pki/ca-trust/source/blacklist/': '/etc/pki/ca-trust/source/blocklist/', ++ '/usr/share/pki/ca-trust-source/blacklist/': '/usr/share/pki/ca-trust-source/blocklist/' ++} ++ ++ ++def _link_src_path(filepath): ++ """ ++ Return expected target path for the symlink. ++ ++ In case the symlink points to one of dirs supposed to be migrated in this ++ actor, we need to point to the new directory instead. ++ ++ In case the link points anywhere else, keep the target path as it is. ++ """ ++ realpath = os.path.realpath(filepath) ++ for dirname in DIRS_CHANGE: ++ if realpath.startswith(dirname): ++ return realpath.replace(dirname, DIRS_CHANGE[dirname]) ++ ++ # it seems we can keep this path ++ return realpath ++ ++ ++def _migrate_file(filename, src_basedir): ++ dst_path = filename.replace(src_basedir, DIRS_CHANGE[src_basedir]) ++ if os.path.exists(dst_path): ++ api.current_logger().info( ++ 'Skipping migration of the {} certificate. The target file already exists' ++ .format(filename) ++ ) ++ return ++ os.makedirs(os.path.dirname(dst_path), mode=0o755, exist_ok=True) ++ if os.path.islink(filename): ++ # create the new symlink instead of the moving the file ++ # as the target path could be different as well ++ link_src_path = _link_src_path(filename) ++ # TODO: is the broken symlink ok? ++ os.symlink(link_src_path, dst_path) ++ os.unlink(filename) ++ else: ++ # normal file, just move it ++ shutil.move(filename, dst_path) ++ ++ ++def _get_files(dirname): ++ return run(['find', dirname, '-type', 'f,l'], split=True)['stdout'] ++ ++ ++def process(): ++ for dirname in DIRS_CHANGE: ++ if not os.path.exists(dirname): ++ # The directory does not exist; nothing to do here ++ continue ++ try: ++ blacklisted_certs = _get_files(dirname) ++ except (CalledProcessError, OSError) as e: ++ # TODO: create post-upgrade report ++ api.current_logger().error('Cannot get list of files in {}: {}.'.format(dirname, e)) ++ api.current_logger().error('Certificates under {} must be migrated manually.'.format(dirname)) ++ continue ++ failed_files = [] ++ for filename in blacklisted_certs: ++ try: ++ _migrate_file(filename, dirname) ++ except OSError as e: ++ api.current_logger().error( ++ 'Failed migration of blacklisted certificate {}: {}' ++ .format(filename, e) ++ ) ++ failed_files.append(filename) ++ if not failed_files: ++ # the failed removal is not such a big issue here ++ # clean the dir if all files have been migrated successfully ++ shutil.rmtree(dirname, ignore_errors=True) ++ try: ++ run(['/usr/bin/update-ca-trust']) ++ except (CalledProcessError, OSError) as e: ++ api.current_logger().error( ++ 'Cannot update CA trust on the system.' ++ ' It needs to be done manually after the in-place upgrade.' ++ ' Reason: {}'.format(e) ++ ) +diff --git a/repos/system_upgrade/el8toel9/actors/migrateblacklistca/tests/unit_test_migrateblacklistca.py b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/tests/unit_test_migrateblacklistca.py +new file mode 100644 +index 00000000..970dcb97 +--- /dev/null ++++ b/repos/system_upgrade/el8toel9/actors/migrateblacklistca/tests/unit_test_migrateblacklistca.py +@@ -0,0 +1,25 @@ ++import os ++ ++from leapp.libraries.actor import migrateblacklistca ++from leapp.libraries.common.testutils import CurrentActorMocked ++from leapp.libraries.stdlib import api ++ ++ ++class MockedGetFiles(): ++ def __init__(self): ++ self.called = 0 ++ ++ def __call__(self): ++ self.called += 1 ++ return [] ++ ++ ++def test_no_dirs_exist(monkeypatch): ++ mocked_files = MockedGetFiles() ++ monkeypatch.setattr(os.path, 'exists', lambda dummy: False) ++ monkeypatch.setattr(migrateblacklistca, '_get_files', mocked_files) ++ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked()) ++ # this is bad mock, but we want to be sure that update-ca-trust is not ++ # called on the testing machine ++ monkeypatch.setattr(migrateblacklistca, 'run', lambda dummy: dummy) ++ assert not mocked_files.called diff --git a/repos/system_upgrade/wp-toolkit/.leapp/info b/repos/system_upgrade/wp-toolkit/.leapp/info new file mode 100644 -index 0000000..e4059e3 +index 00000000..e4059e30 --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/.leapp/info @@ -0,0 +1 @@ @@ -7328,7 +7716,7 @@ index 0000000..e4059e3 \ No newline at end of file diff --git a/repos/system_upgrade/wp-toolkit/.leapp/leapp.conf b/repos/system_upgrade/wp-toolkit/.leapp/leapp.conf new file mode 100644 -index 0000000..b459134 +index 00000000..b4591347 --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/.leapp/leapp.conf @@ -0,0 +1,6 @@ @@ -7340,7 +7728,7 @@ index 0000000..b459134 +path=${repository:state_dir}/leapp.db diff --git a/repos/system_upgrade/wp-toolkit/actors/setwptoolkityumvariable/actor.py b/repos/system_upgrade/wp-toolkit/actors/setwptoolkityumvariable/actor.py new file mode 100644 -index 0000000..f386358 +index 00000000..f386358d --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/actors/setwptoolkityumvariable/actor.py @@ -0,0 +1,65 @@ @@ -7411,7 +7799,7 @@ index 0000000..f386358 + api.current_logger().info('{} not an active vendor: skipping actor'.format(VENDOR_NAME)) diff --git a/repos/system_upgrade/wp-toolkit/actors/updatewptoolkitrepos/actor.py b/repos/system_upgrade/wp-toolkit/actors/updatewptoolkitrepos/actor.py new file mode 100644 -index 0000000..f1c6839 +index 00000000..f1c6839a --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/actors/updatewptoolkitrepos/actor.py @@ -0,0 +1,49 @@ @@ -7466,7 +7854,7 @@ index 0000000..f1c6839 + api.current_logger().info('{} not an active vendor: skipping actor'.format(VENDOR_NAME)) diff --git a/repos/system_upgrade/wp-toolkit/actors/wptoolkitfacts/actor.py b/repos/system_upgrade/wp-toolkit/actors/wptoolkitfacts/actor.py new file mode 100644 -index 0000000..a2925dd +index 00000000..a2925dda --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/actors/wptoolkitfacts/actor.py @@ -0,0 +1,55 @@ @@ -7527,7 +7915,7 @@ index 0000000..a2925dd + api.current_logger().info('{} not an active vendor: skipping actor'.format(VENDOR_NAME)) diff --git a/repos/system_upgrade/wp-toolkit/actors/wptoolkitfacts/tests/test_wptoolkitfacts.py b/repos/system_upgrade/wp-toolkit/actors/wptoolkitfacts/tests/test_wptoolkitfacts.py new file mode 100644 -index 0000000..551c2af +index 00000000..551c2aff --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/actors/wptoolkitfacts/tests/test_wptoolkitfacts.py @@ -0,0 +1,38 @@ @@ -7571,7 +7959,7 @@ index 0000000..551c2af + assert message.version == '0.1' diff --git a/repos/system_upgrade/wp-toolkit/files/wp-toolkit-cpanel.el8.repo b/repos/system_upgrade/wp-toolkit/files/wp-toolkit-cpanel.el8.repo new file mode 100644 -index 0000000..adfd7b6 +index 00000000..adfd7b6c --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/files/wp-toolkit-cpanel.el8.repo @@ -0,0 +1,11 @@ @@ -7588,7 +7976,7 @@ index 0000000..adfd7b6 +gpgcheck=1 diff --git a/repos/system_upgrade/wp-toolkit/models/wptoolkit.py b/repos/system_upgrade/wp-toolkit/models/wptoolkit.py new file mode 100644 -index 0000000..9df3c0d +index 00000000..9df3c0d8 --- /dev/null +++ b/repos/system_upgrade/wp-toolkit/models/wptoolkit.py @@ -0,0 +1,23 @@