From 4b79a63266b76a17df47c544a19a70e063e1a6eb Mon Sep 17 00:00:00 2001 From: Dom Whewell Date: Fri, 20 Sep 2024 18:24:25 +0100 Subject: [PATCH] Change logging types in docker_pull --- bbot/modules/docker_pull.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bbot/modules/docker_pull.py b/bbot/modules/docker_pull.py index 0d1f63c29..65594736b 100644 --- a/bbot/modules/docker_pull.py +++ b/bbot/modules/docker_pull.py @@ -86,12 +86,12 @@ async def docker_api_request(self, url: str): service = www_authenticate_headers.split('service="')[1].split('"')[0] scope = www_authenticate_headers.split('scope="')[1].split('"')[0] except (KeyError, IndexError): - self.log.error(f"Could not obtain realm, service or scope from {url}") + self.log.warning(f"Could not obtain realm, service or scope from {url}") break auth_url = f"{realm}?service={service}&scope={scope}" auth_response = await self.helpers.request(auth_url) if not auth_response: - self.log.error(f"Could not obtain token from {auth_url}") + self.log.warning(f"Could not obtain token from {auth_url}") break auth_json = auth_response.json() token = auth_json["token"] @@ -103,6 +103,7 @@ async def get_tags(self, registry, repository): r = await self.docker_api_request(url) if r is None or r.status_code != 200: self.log.warning(f"Could not retrieve all tags for {repository} asuming tag:latest only.") + self.log.debug(f"Response: {r}") return ["latest"] try: tags = r.json().get("tags", ["latest"]) @@ -115,14 +116,15 @@ async def get_tags(self, registry, repository): else: return [tags[-1]] except (KeyError, IndexError): - self.log.error(f"Could not retrieve tags for {repository}.") + self.log.warning(f"Could not retrieve tags for {repository}.") return ["latest"] async def get_manifest(self, registry, repository, tag): url = f"{registry}/v2/{repository}/manifests/{tag}" r = await self.docker_api_request(url) if r is None or r.status_code != 200: - self.log.error(f"Could not retrieve manifest for {repository}:{tag}.") + self.log.warning(f"Could not retrieve manifest for {repository}:{tag}.") + self.log.debug(f"Response: {r}") return {} response_json = r.json() if response_json.get("manifests", []):