From 3bd08f8ac0d57676d3cad2d4b65b70a91ee057a0 Mon Sep 17 00:00:00 2001 From: tomasfratrik Date: Fri, 19 Jul 2024 15:37:44 +0200 Subject: [PATCH] Put message into exception def. and fix url link --- .../common/actors/systemfacts/libraries/systemfacts.py | 9 +++------ repos/system_upgrade/common/libraries/repofileutils.py | 4 +++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py b/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py index b74e2592e7..f16cea1dcb 100644 --- a/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py +++ b/repos/system_upgrade/common/actors/systemfacts/libraries/systemfacts.py @@ -221,14 +221,11 @@ def get_repositories_status(): return RepositoriesFacts(repositories=repofileutils.get_parsed_repofiles()) except repofileutils.InvalidRepoDefinition as e: raise StopActorExecutionError( - message='Invalid repository definition', + message=str(e), details={ - 'details': str(e), - 'file': e.repofile, - 'repoid': e.repoid, - 'hint': 'To resolve this issue, please visit: {url}' + 'hint': 'For more directions on how to resolve the issue, see: {url}.' .format( - url='https://access.redhat.com/solutions/3185891' + url='https://access.redhat.com/solutions/6969001' ) } ) diff --git a/repos/system_upgrade/common/libraries/repofileutils.py b/repos/system_upgrade/common/libraries/repofileutils.py index ce958c1831..b998044855 100644 --- a/repos/system_upgrade/common/libraries/repofileutils.py +++ b/repos/system_upgrade/common/libraries/repofileutils.py @@ -12,7 +12,9 @@ class InvalidRepoDefinition(Exception): - def __init__(self, message, repofile=None, repoid=None): + def __init__(self, msg, repofile=None, repoid=None): + message = 'Invalid repository definition: {repoid} in: {repofile}: {msg}'.format( + repoid=repoid, repofile=repofile, msg=msg) super(InvalidRepoDefinition, self).__init__(message) self.repofile = repofile self.repoid = repoid