11from leapp .models import CustomTargetRepositoryFile , TargetRepositories
22from leapp .libraries .stdlib import api
33from leapp import reporting
4- from leapp .libraries .common import rhsm
4+ from leapp .libraries .common import config , rhsm
55
66
77_IPU_DOC_URL = ('https://access.redhat.com/documentation/en-us/'
@@ -24,6 +24,10 @@ def _the_custom_repofile_defined():
2424 return False
2525
2626
27+ def _the_enablerepo_option_used ():
28+ return config .get_env ('LEAPP_ENABLE_REPOS' , None ) is not None
29+
30+
2731def process ():
2832 if not rhsm .skip_rhsm ():
2933 # getting RH repositories through RHSM; resolved by seatbelts
@@ -33,16 +37,17 @@ def process():
3337 # rhsm skipped; take your seatbelts please
3438 is_ctr = _any_custom_repo_defined ()
3539 is_ctrf = _the_custom_repofile_defined ()
40+ is_re = _the_enablerepo_option_used ()
3641 if not is_ctr :
3742 # no rhsm, no custom repositories.. this will really not work :)
3843 # TODO: add link to the RH article about use of custom repositories!!
3944 # NOTE: we can put here now the link to the main document, as this
4045 # will be described there or at least the link to the right document
4146 # will be delivered here.
4247 if is_ctrf :
43- summary_ctrf = 'The custom repository file has been detected. Maybe it is empty?'
48+ summary_ctrf = '\n \n The custom repository file has been detected. Maybe it is empty?'
4449 else :
45- summary_ctrf = 'The custom repository file has not been detected. '
50+ summary_ctrf = ''
4651 reporting .create_report ([
4752 reporting .Title ('Using RHSM has been skipped but no custom repositories have been delivered.' ),
4853 reporting .Summary (
@@ -66,17 +71,18 @@ def process():
6671 reporting .ExternalLink (url = _IPU_DOC_URL , title = 'UPGRADING TO RHEL 8' ),
6772 reporting .RelatedResource ('file' , CUSTOM_REPO_PATH ),
6873 ])
69- elif not is_ctrf :
74+ elif not ( is_ctrf or is_re ) :
7075 # Some custom repositories have been discovered, but the custom repo
71- # file not. Inform about the official recommended way.
76+ # file not - neither the --enablerepo option is usedd. Inform about
77+ # the official recommended way.
7278 reporting .create_report ([
73- reporting .Title ('CustomTargetRepositories discovered, but the CustomTargetRepositoryFile is missing .' ),
79+ reporting .Title ('CustomTargetRepositories discovered, but no new provided mechanisms used .' ),
7480 reporting .Summary (
7581 'Red Hat provides now official way how to use custom'
7682 ' repositories during the in-place upgrade through'
77- ' the referred custom repository file. The CustomTargetRepositories '
78- ' have been detected (from custom actors?) but the repository '
79- ' file not. '
83+ ' the referred custom repository file or through the '
84+ ' --enablerepo option for leapp. The CustomTargetRepositories '
85+ ' have been produced from custom (own) actors? '
8086 ),
8187 reporting .Remediation (hint = (
8288 'Follow the new simple way to enable custom repositories'
0 commit comments