Skip to content

Commit d9af1f2

Browse files
authored
Utilize get_target_major_version in no enabled target repositories report (oamg#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]>
1 parent 2340bd5 commit d9af1f2

File tree

1 file changed

+10
-5
lines changed
  • repos/system_upgrade/common/actors/targetuserspacecreator/libraries

1 file changed

+10
-5
lines changed

repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,10 @@ def _get_rhsm_available_repoids(context):
678678

679679
).format(target_major_version)),
680680
reporting.ExternalLink(
681-
# TODO: How to handle different documentation links for each version?
682-
url='https://red.ht/preparing-for-upgrade-to-rhel8',
681+
# https://red.ht/preparing-for-upgrade-to-rhel8
682+
# https://red.ht/preparing-for-upgrade-to-rhel9
683+
# https://red.ht/preparing-for-upgrade-to-rhel10
684+
url='https://red.ht/preparing-for-upgrade-to-rhel{}'.format(target_major_version),
683685
title='Preparing for the upgrade')
684686
])
685687
raise StopActorExecution()
@@ -812,6 +814,7 @@ def gather_target_repositories(context, indata):
812814
missing_custom_repoids.append(custom_repo.repoid)
813815
api.current_logger().debug("Gathered target repositories: {}".format(', '.join(target_repoids)))
814816
if not target_repoids:
817+
target_major_version = get_target_major_version()
815818
reporting.create_report([
816819
reporting.Title('There are no enabled target repositories'),
817820
reporting.Summary(
@@ -833,8 +836,10 @@ def gather_target_repositories(context, indata):
833836
' Finally, verify that the "/etc/leapp/files/repomap.json" file is up-to-date.'
834837
).format(version=api.current_actor().configuration.version.target)),
835838
reporting.ExternalLink(
836-
# TODO: How to handle different documentation links for each version?
837-
url='https://red.ht/preparing-for-upgrade-to-rhel8',
839+
# https://red.ht/preparing-for-upgrade-to-rhel8
840+
# https://red.ht/preparing-for-upgrade-to-rhel9
841+
# https://red.ht/preparing-for-upgrade-to-rhel10
842+
url='https://red.ht/preparing-for-upgrade-to-rhel{}'.format(target_major_version),
838843
title='Preparing for the upgrade'),
839844
reporting.RelatedResource("file", "/etc/leapp/files/repomap.json"),
840845
reporting.RelatedResource("file", "/etc/yum.repos.d/")
@@ -854,7 +859,7 @@ def gather_target_repositories(context, indata):
854859
reporting.Groups([reporting.Groups.INHIBITOR]),
855860
reporting.Severity(reporting.Severity.HIGH),
856861
reporting.ExternalLink(
857-
# TODO: How to handle different documentation links for each version?
862+
# NOTE: Article covers both RHEL 7 to RHEL 8 and RHEL 8 to RHEL 9
858863
url='https://access.redhat.com/articles/4977891',
859864
title='Customizing your Red Hat Enterprise Linux in-place upgrade'),
860865
reporting.Remediation(hint=(

0 commit comments

Comments
 (0)