Enhance subcloud upgrade orchestration failure message

If a subcloud fails to be upgraded due to missing rvmc image,
the error message is unclear. This commit improves the error
message.

Test Plan:
PASS: Unit test on exception
PASS: Manually raised exception with mock values locally

Task: 47562
Story: 2009303
Signed-off-by: Luis Eduardo Bonatti <LuizEduardo.Bonatti@windriver.com>
Change-Id: I3082145c2ec4b715c35e7cf0477c0287b2151de6
This commit is contained in:
Luis Eduardo Bonatti 2023-03-01 09:34:35 -03:00
parent 0b0844d51b
commit 5a032f4aba
2 changed files with 8 additions and 1 deletions

View File

@ -113,3 +113,9 @@ class PlaybookExecutionFailed(DCCommonException):
class PlaybookExecutionTimeout(PlaybookExecutionFailed):
message = _("Playbook execution failed [TIMEOUT (%(timeout)s)], "
"command=%(playbook_cmd)s")
class ImageNotInLocalRegistry(NotFound):
message = _("Image %(image_name)s:%(image_tag)s not found in the local registry. "
"Please check with command: system registry-image-list or "
"system registry-image-tags %(image_name)s")

View File

@ -195,7 +195,8 @@ class SubcloudInstall(object):
msg = "Error: Image %s:%s not found in the local registry." % (
image_name, image_tag)
LOG.error(msg)
raise exceptions.NotFound()
raise exceptions.ImageNotInLocalRegistry(image_name=image_name,
image_tag=image_tag)
@staticmethod
def create_rvmc_config_file(override_path, payload):