Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 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 All @@ -91,6 +93,7 @@ def _download_one(self, url, checksum):
location.flush()

self.verify_checksum(location, url, checksum, url)
return location

def verify_checksum(self, location, name, checksum, url):
"""Verify the image's checksum."""
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