Skip to content

Commit

Permalink
Don't fetch release infos when trusting the cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Feb 2, 2024
1 parent 0fc6fea commit efb093f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/135-trust-core-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "Avoid superfluous network request when trusting the ansible-core download cache (https://github.com/ansible-community/antsibull-core/pull/135)."
3 changes: 2 additions & 1 deletion src/antsibull_core/ansible_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ async def retrieve(self, ansible_core_version: str, download_dir: StrPath) -> st
:returns: The name of the downloaded tarball.
"""
package_name = "ansible-core"
release_info = await self.get_release_info(package_name)

tar_filename = f"{package_name}-{ansible_core_version}.tar.gz"
tar_path = os.path.join(download_dir, tar_filename)
Expand All @@ -136,6 +135,8 @@ async def retrieve(self, ansible_core_version: str, download_dir: StrPath) -> st
await copy_file(cached_path, tar_path, check_content=False)
return tar_path

release_info = await self.get_release_info(package_name)

pypi_url = ""
digests = {}
for release in release_info[ansible_core_version]:
Expand Down

0 comments on commit efb093f

Please sign in to comment.