diff --git a/repos/system_upgrade/el7toel8/actors/checktargetrepos/actor.py b/repos/system_upgrade/el7toel8/actors/checktargetrepos/actor.py index 08e766a954..c128b91f55 100644 --- a/repos/system_upgrade/el7toel8/actors/checktargetrepos/actor.py +++ b/repos/system_upgrade/el7toel8/actors/checktargetrepos/actor.py @@ -8,18 +8,23 @@ class Checktargetrepos(Actor): """ Check whether target yum repositories are specified. - RHSM | CTR | CTRF || result - -----+-----+------++------- - Yes | --- | ---- || - - -----+-----+------++------- - No | No | No || inhibit - -----+-----+------++------- - No | No | Yes || inhibit - -----+-----+------++------- - No | Yes | No || warn/report info - -----+-----+------++------- - No | Yes | Yes || - + RHSM | ER | CTR | CTRF || result + -----+----+-----+------++------- + Yes | -- | --- | ---- || - + -----+----+-----+------++------- + No | -- | No | No || inhibit + -----+----+-----+------++------- + No | -- | No | Yes || inhibit + -----+----+-----+------++------- + No | No | Yes | No || warn/report info + -----+----+-----+------++------- + No | No | Yes | Yes || - + -----+----+-----+------++------- + No | Yes| Yes | No || - + -----+----+-----+------++------- + No | Yes| Yes | Yes || - + ER - config.get_env('LEAPP_ENABLE_REPOS') is non-empty CTR - CustomTargetRepositories found CTRF - the expected CustomTargetRepositoryFile found RHSM - RHSM is used (it is not skipped) diff --git a/repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py b/repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py index 7ef599965e..b91fd885e2 100644 --- a/repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py +++ b/repos/system_upgrade/el7toel8/actors/checktargetrepos/libraries/library.py @@ -1,7 +1,7 @@ from leapp.models import CustomTargetRepositoryFile, TargetRepositories from leapp.libraries.stdlib import api from leapp import reporting -from leapp.libraries.common import rhsm +from leapp.libraries.common import config, rhsm _IPU_DOC_URL = ('https://access.redhat.com/documentation/en-us/' @@ -24,6 +24,10 @@ def _the_custom_repofile_defined(): return False +def _the_enablerepo_option_used(): + return config.get_env('LEAPP_ENABLE_REPOS', None) is not None + + def process(): if not rhsm.skip_rhsm(): # getting RH repositories through RHSM; resolved by seatbelts @@ -33,6 +37,7 @@ def process(): # rhsm skipped; take your seatbelts please is_ctr = _any_custom_repo_defined() is_ctrf = _the_custom_repofile_defined() + is_re = _the_enablerepo_option_used() if not is_ctr: # no rhsm, no custom repositories.. this will really not work :) # TODO: add link to the RH article about use of custom repositories!! @@ -40,9 +45,9 @@ def process(): # will be described there or at least the link to the right document # will be delivered here. if is_ctrf: - summary_ctrf = 'The custom repository file has been detected. Maybe it is empty?' + summary_ctrf = '\n\nThe custom repository file has been detected. Maybe it is empty?' else: - summary_ctrf = 'The custom repository file has not been detected.' + summary_ctrf = '' reporting.create_report([ reporting.Title('Using RHSM has been skipped but no custom repositories have been delivered.'), reporting.Summary( @@ -66,17 +71,18 @@ def process(): reporting.ExternalLink(url=_IPU_DOC_URL, title='UPGRADING TO RHEL 8'), reporting.RelatedResource('file', CUSTOM_REPO_PATH), ]) - elif not is_ctrf: + elif not (is_ctrf or is_re): # Some custom repositories have been discovered, but the custom repo - # file not. Inform about the official recommended way. + # file not - neither the --enablerepo option is usedd. Inform about + # the official recommended way. reporting.create_report([ - reporting.Title('CustomTargetRepositories discovered, but the CustomTargetRepositoryFile is missing.'), + reporting.Title('CustomTargetRepositories discovered, but no new provided mechanisms used.'), reporting.Summary( 'Red Hat provides now official way how to use custom' ' repositories during the in-place upgrade through' - ' the referred custom repository file. The CustomTargetRepositories' - ' have been detected (from custom actors?) but the repository' - ' file not.' + ' the referred custom repository file or through the' + ' --enablerepo option for leapp. The CustomTargetRepositories' + ' have been produced from custom (own) actors?' ), reporting.Remediation(hint=( 'Follow the new simple way to enable custom repositories' diff --git a/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py index 0f588ff000..d579e5dff7 100644 --- a/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py +++ b/repos/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py @@ -332,7 +332,9 @@ def gather_target_repositories(context): ' your current subscription is entitled to install the requested target version {version}.' ' In case the --no-rhsm option (or the LEAPP_NO_RHSM=1 environment variable is set)' ' ensure the custom repository file is provided regarding the documentation with' - ' properly defined repositories.' + ' properly defined repositories or in case repositories are already defined' + ' in any repofiles under /etc/yum.repos.d/ directory, use the --enablerepo option' + ' for leapp' ).format(version=api.current_actor().configuration.version.target) } ) @@ -341,11 +343,14 @@ def gather_target_repositories(context): message='Some required custom target repositories are not available.', details={'hint': ( ' The most probably you are using custom or third party actor' - ' that produces CustomTargetRepository message. However,' - ' inside the upgrade container, we are not able to find such' + ' that produces CustomTargetRepository message or you did a typo' + ' in one of repoids specified on command line for the leapp --enablerepo' + ' option.' + ' Inside the upgrade container, we are not able to find such' ' repository inside any repository file. Consider use of the' ' custom repository file regarding the official upgrade' - ' documentation.' + ' documentation or check whether you did not do a typo in any' + ' repoids you specified for the --enablerepo option of leapp.' ) } )