[stable-2.15] ansible-test - Use PyPI proxy for centos7 (#83226) (#83228)

(cherry picked from commit c0f7e9cc2c)
pull/83240/head
Matt Clay 3 weeks ago committed by GitHub
parent 2e32adac3f
commit d65905f998
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- ansible-test - Automatically enable the PyPI proxy for the ``centos7`` container to restore the ability to use ``pip`` in that container.

@ -14,6 +14,7 @@ from .config import (
from .host_configs import (
PosixConfig,
DockerConfig,
)
from .util import (
@ -55,8 +56,14 @@ def run_pypi_proxy(args: EnvironmentConfig, targets_use_pypi: bool) -> None:
return # user has overridden the proxy endpoint, there is nothing to provision
versions_needing_proxy: tuple[str, ...] = tuple() # preserved for future use, no versions currently require this
containers_needing_proxy: set[str] = {'centos7'}
posix_targets = [target for target in args.targets if isinstance(target, PosixConfig)]
need_proxy = targets_use_pypi and any(target.python.version in versions_needing_proxy for target in posix_targets)
need_proxy = targets_use_pypi and any(
target.python.version in versions_needing_proxy or
(isinstance(target, DockerConfig) and target.name in containers_needing_proxy)
for target in posix_targets
)
use_proxy = args.pypi_proxy or need_proxy
if not use_proxy:

Loading…
Cancel
Save