Skip to content

Commit

Permalink
feat: improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolopez committed Sep 26, 2024
1 parent 22d03c3 commit d560b8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions imgsync/distros/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def _download_one(self, url, checksum):
:param checksum: tuple in the form (checksum_name, checksum_value)
:returns: temporary file object
"""
LOG.info("Downloading %s", url)

with tempfile.NamedTemporaryFile(suffix=".imgsync", delete=False) as location:
try:
response = requests.get(url, stream=True, timeout=10)
Expand Down
2 changes: 1 addition & 1 deletion imgsync/distros/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _sync_latest(self):
LOG.error("Could not find checksum for %s" % filename)
return

LOG.info("Downloading %s", filename)
LOG.info("Syncing %s", filename)

url = base_url + filename
architecture = "x86_64"
Expand Down
4 changes: 3 additions & 1 deletion imgsync/distros/ubuntu.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def url(self):
def _sync_latest(self):
"""Sync the latest image."""
filename = self.filename
LOG.info("Downloading %s", filename)

LOG.info("Syncing %s", filename)

base_url = self.url + "current/"
checksum_file = base_url + "SHA256SUMS"
checksum_file = requests.get(checksum_file, timeout=10)
Expand Down

0 comments on commit d560b8c

Please sign in to comment.