diff --git a/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py b/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py index 75c3ea8930..23fef83ec7 100644 --- a/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py +++ b/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py @@ -5,6 +5,7 @@ from leapp.exceptions import StopActorExecutionError from leapp.libraries.actor import peseventsscanner_repomap from leapp.libraries.actor.pes_event_parsing import Action, get_pes_events, Package +from leapp.libraries.common import rpms from leapp.libraries.common.config import version from leapp.libraries.stdlib import api from leapp.libraries.stdlib.config import is_verbose @@ -481,11 +482,8 @@ def apply_transaction_configuration(source_pkgs): def remove_leapp_related_events(events): - leapp_pkgs = [ - 'leapp', 'leapp-deps', 'leapp-upgrade-el7toel8', 'leapp-upgrade-el8toel9', - 'leapp-upgrade-el7toel8-deps', 'leapp-upgrade-el8toel9-deps', 'python2-leapp', - 'python3-leapp', 'snactor' - ] + leapp_pkgs = rpms.get_leapp_dep_packages( + major_version=['7', '8']) + rpms.get_leapp_packages(major_version=['7', '8']) res = [] for event in events: if not any(pkg.name in leapp_pkgs for pkg in event.in_pkgs): diff --git a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py index 8150c16470..7cdcf82052 100644 --- a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py +++ b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py @@ -404,7 +404,10 @@ def test_pkgs_are_demodularized_when_crossing_major_version(monkeypatch): assert target_pkgs == expected_target_pkgs -def test_remove_leapp_related_events(): +def test_remove_leapp_related_events(monkeypatch): + # NOTE(ivasilev) That's required to use leapp library functions that rely on calls to + # get_source/target_system_version functions + monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(arch='x86_64', src_ver='7.9', dst_ver='8.8')) # these are just hypothetical and not necessarily correct package_set_two_leapp = {Package('leapp-upgrade-el7toel8', 'repoid-rhel7', None), Package('leapp-upgrade-el7toel8-deps', 'repoid-rhel7', None)}