From f4b0c22e8322eb8afd6abe1808def081b586d8e0 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: May 13 2024 00:14:14 +0000 Subject: Include URL in upload/download I was trying to debug why my uploaded sources aren't being found, and it'd be really useful to know exactly what base URL is in use. Signed-off-by: Colin Walters --- diff --git a/pyrpkg/lookaside.py b/pyrpkg/lookaside.py index b2abf2c..72109bf 100644 --- a/pyrpkg/lookaside.py +++ b/pyrpkg/lookaside.py @@ -164,7 +164,7 @@ class CGILookasideCache(object): self.log.info("Not downloading already downloaded %s" % filename) return - self.log.info("Downloading %s", filename) + self.log.info("Downloading %s from %s", filename, self.download_url) urled_file = urllib.parse.quote(filename) url = self.get_download_url(name, urled_file, hash, hashtype, **kwargs) if isinstance(url, six.text_type): @@ -276,6 +276,7 @@ class CGILookasideCache(object): if status != 200: self.raise_upload_error(status) + self.log.debug("%s returned status %d", self.upload_url, status) # Lookaside CGI script returns these strings depending on whether # or not the file exists: @@ -303,8 +304,8 @@ class CGILookasideCache(object): :param str hash: The known good hash of the file. :param bool offline: Method prints a message about disabled upload and does return. """ + self.log.info("Uploading: %s to %s", filepath, self.upload_url) if offline: - self.log.info("Uploading: %s", filepath) self.log.info("*Upload disabled*") return