diff --git a/changelogs/fragments/135-trust-core-cache.yml b/changelogs/fragments/135-trust-core-cache.yml new file mode 100644 index 0000000..3a7e52c --- /dev/null +++ b/changelogs/fragments/135-trust-core-cache.yml @@ -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)." diff --git a/src/antsibull_core/ansible_core.py b/src/antsibull_core/ansible_core.py index bea28f6..692a59a 100644 --- a/src/antsibull_core/ansible_core.py +++ b/src/antsibull_core/ansible_core.py @@ -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) @@ -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]: