Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfratrik committed Aug 15, 2024
1 parent f2bd7b4 commit 1d92a7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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+)'
Expand All @@ -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,
Expand All @@ -44,4 +44,4 @@ def process():
pgpsig=pgpsig
))

api.produce(leftover_pkgs_to_remove)
api.produce(LeftoverPackages(items=leftover_pkgs_to_remove))
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1d92a7e

Please sign in to comment.