Skip to content

Commit

Permalink
Utilize get_target_major_version in no enabled target repositories re…
Browse files Browse the repository at this point in the history
…port (#1151)

* Utilize get_target_major_version in no enabled target repositories report
  so the shortened URL in the report points to the right documentation based
  based on the target OS major version.
* Add expected docs URLs to comments for easier grep

Signed-off-by: Andrea Waltlova <[email protected]>
  • Loading branch information
andywaltlova authored Nov 26, 2023
1 parent 2340bd5 commit d9af1f2
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,10 @@ def _get_rhsm_available_repoids(context):

).format(target_major_version)),
reporting.ExternalLink(
# TODO: How to handle different documentation links for each version?
url='https://red.ht/preparing-for-upgrade-to-rhel8',
# https://red.ht/preparing-for-upgrade-to-rhel8
# https://red.ht/preparing-for-upgrade-to-rhel9
# https://red.ht/preparing-for-upgrade-to-rhel10
url='https://red.ht/preparing-for-upgrade-to-rhel{}'.format(target_major_version),
title='Preparing for the upgrade')
])
raise StopActorExecution()
Expand Down Expand Up @@ -812,6 +814,7 @@ def gather_target_repositories(context, indata):
missing_custom_repoids.append(custom_repo.repoid)
api.current_logger().debug("Gathered target repositories: {}".format(', '.join(target_repoids)))
if not target_repoids:
target_major_version = get_target_major_version()
reporting.create_report([
reporting.Title('There are no enabled target repositories'),
reporting.Summary(
Expand All @@ -833,8 +836,10 @@ def gather_target_repositories(context, indata):
' Finally, verify that the "/etc/leapp/files/repomap.json" file is up-to-date.'
).format(version=api.current_actor().configuration.version.target)),
reporting.ExternalLink(
# TODO: How to handle different documentation links for each version?
url='https://red.ht/preparing-for-upgrade-to-rhel8',
# https://red.ht/preparing-for-upgrade-to-rhel8
# https://red.ht/preparing-for-upgrade-to-rhel9
# https://red.ht/preparing-for-upgrade-to-rhel10
url='https://red.ht/preparing-for-upgrade-to-rhel{}'.format(target_major_version),
title='Preparing for the upgrade'),
reporting.RelatedResource("file", "/etc/leapp/files/repomap.json"),
reporting.RelatedResource("file", "/etc/yum.repos.d/")
Expand All @@ -854,7 +859,7 @@ def gather_target_repositories(context, indata):
reporting.Groups([reporting.Groups.INHIBITOR]),
reporting.Severity(reporting.Severity.HIGH),
reporting.ExternalLink(
# TODO: How to handle different documentation links for each version?
# NOTE: Article covers both RHEL 7 to RHEL 8 and RHEL 8 to RHEL 9
url='https://access.redhat.com/articles/4977891',
title='Customizing your Red Hat Enterprise Linux in-place upgrade'),
reporting.Remediation(hint=(
Expand Down

0 comments on commit d9af1f2

Please sign in to comment.