diff --git a/CHANGES/617.bugfix b/CHANGES/617.bugfix new file mode 100644 index 000000000..ad1d716b9 --- /dev/null +++ b/CHANGES/617.bugfix @@ -0,0 +1 @@ +Fixed check for the signature source location. diff --git a/pulp_container/app/tasks/sync_stages.py b/pulp_container/app/tasks/sync_stages.py index b6f49578b..da61bfdcc 100644 --- a/pulp_container/app/tasks/sync_stages.py +++ b/pulp_container/app/tasks/sync_stages.py @@ -87,13 +87,16 @@ async def get_signature_source(self): registry_v2_url = urljoin(self.remote.url, "v2") extension_check_downloader = self.remote.get_noauth_downloader(url=registry_v2_url) + response_headers = {} try: await extension_check_downloader.run() + response_headers = extension_check_downloader.response_headers except aiohttp.client_exceptions.ClientResponseError as exc: - if exc.status in [200, 401]: + if exc.status == 401: response_headers = dict(exc.headers) - if response_headers.get(SIGNATURE_HEADER) == "1": - return SIGNATURE_SOURCE.API_EXTENSION + finally: + if response_headers.get(SIGNATURE_HEADER) == "1": + return SIGNATURE_SOURCE.API_EXTENSION tag_list = [] tag_dcs = []