Skip to content

Commit

Permalink
Use newly introduced get_leapp_packages function
Browse files Browse the repository at this point in the history
Let's refactor the code using the brand new library function
specifically introduced for this exact purpose.
  • Loading branch information
fernflower committed Jan 11, 2024
1 parent c65903c commit 18c4f9b
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import os

from leapp.exceptions import StopActorExecution
from leapp.libraries.common import dnfconfig
from leapp.libraries.common.config.version import get_source_major_version, get_target_major_version
from leapp.libraries.common import rpms
from leapp.libraries.stdlib import api, CalledProcessError, run
from leapp.models import CustomModifications

Expand All @@ -18,17 +17,11 @@ def _get_dirs_to_check(component):


def _get_rpms_to_check(component=None):
# NOTE(ivasilev) Still not sure that library function is the way to go as looks like leapp file changes have
# to be handled differently, and configuration change has to be tracked only for leapp-repository as well.
# Let's keep it here for now but I am probably switching to LEAPP_PKG and LEAPP_REPO_PKG in the next commit.
leapp_installation = set(dnfconfig.get_leapp_packages()) - set(LEAPP_PACKAGES_TO_IGNORE)
leapp_repo = ['leapp-upgrade-el{source}toel{target}'.format(source=get_source_major_version(),
target=get_target_major_version())]
if component == 'repository':
return leapp_repo
return rpms.get_leapp_packages(component=rpms.LeappComponents.REPOSITORY)
if component == 'framework':
return list(leapp_installation - set(leapp_repo))
return list(leapp_installation)
return rpms.get_leapp_packages(component=rpms.LeappComponents.FRAMEWORK)
return rpms.get_leapp_packages(components=[rpms.LeappComponents.REPOSITORY, rpms.LeappComponents.FRAMEWORK])


def deduce_actor_name(a_file):
Expand Down

0 comments on commit 18c4f9b

Please sign in to comment.