From 1d92a7e37a53bc4aff5acba0512d457025cc6584 Mon Sep 17 00:00:00 2001 From: tomasfratrik Date: Thu, 15 Aug 2024 14:37:45 +0200 Subject: [PATCH] small changes --- .../libraries/checkleftoverpackages.py | 8 ++++---- .../common/actors/removeleftoverpackages/actor.py | 4 ++-- .../libraries/removeleftoverpackages.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/repos/system_upgrade/common/actors/checkleftoverpackages/libraries/checkleftoverpackages.py b/repos/system_upgrade/common/actors/checkleftoverpackages/libraries/checkleftoverpackages.py index a2e6ecc2a9..83160f1bb4 100644 --- a/repos/system_upgrade/common/actors/checkleftoverpackages/libraries/checkleftoverpackages.py +++ b/repos/system_upgrade/common/actors/checkleftoverpackages/libraries/checkleftoverpackages.py @@ -14,7 +14,7 @@ def process(): if not installed_rpms: return - leftover_pkgs_to_remove = LeftoverPackages() + leftover_pkgs_to_remove = [] unsigned = [pkg.name for pkg in next(api.consume(InstalledUnsignedRPM), InstalledUnsignedRPM()).items] for rpm in installed_rpms: @@ -24,7 +24,7 @@ def process(): try: name, version, release, epoch, packager, arch, pgpsig = rpm.split('|') except ValueError: - api.current_logger().warning('Could not parse rpm: {}'.format(rpm)) + api.current_logger().warning('Could not parse rpm: {}, skipping'.format(rpm)) continue version_pattern = r'el(\d+)' @@ -34,7 +34,7 @@ def process(): major_version = match.group(1) PKGS_NOT_TO_BE_DELETED = set(LEAPP_PACKAGES + LEAPP_DEP_PACKAGES + unsigned) if int(major_version) <= int(get_source_major_version()) and name not in PKGS_NOT_TO_BE_DELETED: - leftover_pkgs_to_remove.items.append(RPM( + leftover_pkgs_to_remove.append(RPM( name=name, version=version, epoch=epoch, @@ -44,4 +44,4 @@ def process(): pgpsig=pgpsig )) - api.produce(leftover_pkgs_to_remove) + api.produce(LeftoverPackages(items=leftover_pkgs_to_remove)) diff --git a/repos/system_upgrade/common/actors/removeleftoverpackages/actor.py b/repos/system_upgrade/common/actors/removeleftoverpackages/actor.py index c6a16a604d..f9316e582a 100644 --- a/repos/system_upgrade/common/actors/removeleftoverpackages/actor.py +++ b/repos/system_upgrade/common/actors/removeleftoverpackages/actor.py @@ -1,7 +1,7 @@ from leapp.actors import Actor from leapp.libraries.actor import removeleftoverpackages from leapp.models import LeftoverPackages, RemovedPackages -from leapp.tags import IPUWorkflowTag, RPMUpgradePhaseTag +from leapp.tags import ExperimentalTag, IPUWorkflowTag, RPMUpgradePhaseTag class RemoveLeftoverPackages(Actor): @@ -16,7 +16,7 @@ class RemoveLeftoverPackages(Actor): name = 'remove_leftover_packages' consumes = (LeftoverPackages, ) produces = (RemovedPackages, ) - tags = (RPMUpgradePhaseTag, IPUWorkflowTag, ) + tags = (RPMUpgradePhaseTag, IPUWorkflowTag, ExperimentalTag, ) def process(self): removeleftoverpackages.process() diff --git a/repos/system_upgrade/common/actors/removeleftoverpackages/libraries/removeleftoverpackages.py b/repos/system_upgrade/common/actors/removeleftoverpackages/libraries/removeleftoverpackages.py index c861361594..6b565b64b1 100644 --- a/repos/system_upgrade/common/actors/removeleftoverpackages/libraries/removeleftoverpackages.py +++ b/repos/system_upgrade/common/actors/removeleftoverpackages/libraries/removeleftoverpackages.py @@ -26,7 +26,7 @@ def _get_removed_packages(installed_rpms): try: name, version, release, epoch, packager, arch, pgpsig = pkg.split('|') except ValueError: - api.current_logger().warning('Could not parse rpm: {}'.format(pkg)) + api.current_logger().warning('Could not parse rpm: {}, skipping'.format(pkg)) continue removed_packages.append(RPM( name=name,