From 57f0fbf5307c10c329e65034dedf35e09ca60cf6 Mon Sep 17 00:00:00 2001 From: Yashvardhan Nanavati Date: Mon, 21 Nov 2022 17:03:22 -0800 Subject: [PATCH] Remove misleading log from API response CLOUDDST-15929 --- iib/workers/tasks/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/iib/workers/tasks/utils.py b/iib/workers/tasks/utils.py index 2648a9c4..6597e386 100644 --- a/iib/workers/tasks/utils.py +++ b/iib/workers/tasks/utils.py @@ -756,6 +756,8 @@ def run_cmd( response: subprocess.CompletedProcess = subprocess.run(cmd, **params) if strict and response.returncode != 0: + if set(['buildah', 'manifest', 'rm']) <= set(cmd) and 'image not known' in response.stderr: + raise IIBError('Manifest list not found locally.') log.error('The command "%s" failed with: %s', ' '.join(cmd), response.stderr) regex: str match: Optional[re.Match] @@ -771,9 +773,6 @@ def run_cmd( match = _regex_reverse_search(regex, response) if match: raise ExternalServiceError(f'{exc_msg}: {": ".join(match.groups()).strip()}') - if set(['buildah', 'manifest', 'rm']) <= set(cmd): - if 'image not known' in response.stderr: - raise IIBError('Manifest list not found locally.') raise IIBError(exc_msg)