Skip to content

Commit

Permalink
fix: sort globbed img files to ensure choosing the earliest match
Browse files Browse the repository at this point in the history
  • Loading branch information
blackboxsw committed Dec 1, 2023
1 parent c1b7bec commit 6b1f625
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pycloudlib/qemu/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _get_latest_image(self, base_url, release, img_name) -> str:
try:
download_dir.mkdir(parents=True, exist_ok=False)
except FileExistsError:
img_files = list(download_dir.glob("*.img"))
img_files = sorted(list(download_dir.glob("*.img")))
if img_files:
self._log.debug("Image already exists, skipping download")
return str(img_files[0].absolute())
Expand Down

0 comments on commit 6b1f625

Please sign in to comment.