Skip to content

Commit

Permalink
mypy: fix missing attribute error
Browse files Browse the repository at this point in the history
Timeout and RetryError expception doesn't return HTTP code, handle it in separate
except clause.

Signed-off-by: Martin Basti <mbasti@redhat.com>
  • Loading branch information
MartinBasti committed Jul 16, 2024
1 parent 1f46fbe commit 5a1396b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion atomic_reactor/plugins/check_base_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,13 @@ def _get_manifest_list(self, image: ImageName) -> requests.Response:

try:
config_blob = reg_client.get_config_from_registry(image, image.tag)
except (HTTPError, RetryError, Timeout) as ex:
except (HTTPError) as ex:
self.log.warning('Unable to fetch config for %s, got error %s',
image, ex.response.status_code)
raise RuntimeError('Unable to fetch config for base image') from ex
except (Timeout, RetryError) as ex:
self.log.warning('Unable to fetch config for %s', image)
raise RuntimeError('Unable to fetch config for base image') from ex

release = config_blob['config']['Labels']['release']
version = config_blob['config']['Labels']['version']
Expand Down

0 comments on commit 5a1396b

Please sign in to comment.