summaryrefslogtreecommitdiff
path: root/test/lib/ansible_test/_internal
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2022-12-09 11:47:58 -0800
committerMatt Clay <matt@mystile.com>2022-12-12 09:51:02 -0800
commitdcc08eec35fde72845d121859abf1ffef1e9030f (patch)
tree1ed07ba2cdbc825ca8a5c0255f6b42cd19fde569 /test/lib/ansible_test/_internal
parent04209d328b1ba23ff11c95f1462143d34bfb1290 (diff)
downloadansible-dcc08eec35fde72845d121859abf1ffef1e9030f.tar.gz
ansible-test - Fix target PyPI proxy config.
Diffstat (limited to 'test/lib/ansible_test/_internal')
-rw-r--r--test/lib/ansible_test/_internal/commands/integration/__init__.py18
-rw-r--r--test/lib/ansible_test/_internal/provisioning.py7
2 files changed, 13 insertions, 12 deletions
diff --git a/test/lib/ansible_test/_internal/commands/integration/__init__.py b/test/lib/ansible_test/_internal/commands/integration/__init__.py
index aa7a3638fe..33bd45f6a0 100644
--- a/test/lib/ansible_test/_internal/commands/integration/__init__.py
+++ b/test/lib/ansible_test/_internal/commands/integration/__init__.py
@@ -99,6 +99,7 @@ from ...host_configs import (
from ...host_profiles import (
ControllerProfile,
+ ControllerHostProfile,
HostProfile,
PosixProfile,
SshTargetHostProfile,
@@ -961,13 +962,10 @@ def command_integration_filter(args: TIntegrationConfig,
return host_state, internal_targets
-def requirements(args: IntegrationConfig, host_state: HostState) -> None:
- """Install requirements."""
- target_profile = host_state.target_profiles[0]
-
- configure_pypi_proxy(args, host_state.controller_profile) # integration, windows-integration, network-integration
-
- if isinstance(target_profile, PosixProfile) and not isinstance(target_profile, ControllerProfile):
- configure_pypi_proxy(args, target_profile) # integration
-
- install_requirements(args, host_state.controller_profile.python, ansible=True, command=True) # integration, windows-integration, network-integration
+def requirements(host_profile: HostProfile) -> None:
+ """Install requirements after bootstrapping and delegation."""
+ if isinstance(host_profile, ControllerHostProfile) and host_profile.controller:
+ configure_pypi_proxy(host_profile.args, host_profile) # integration, windows-integration, network-integration
+ install_requirements(host_profile.args, host_profile.python, ansible=True, command=True) # integration, windows-integration, network-integration
+ elif isinstance(host_profile, PosixProfile) and not isinstance(host_profile, ControllerProfile):
+ configure_pypi_proxy(host_profile.args, host_profile) # integration
diff --git a/test/lib/ansible_test/_internal/provisioning.py b/test/lib/ansible_test/_internal/provisioning.py
index 815deaa352..8f914c2aa4 100644
--- a/test/lib/ansible_test/_internal/provisioning.py
+++ b/test/lib/ansible_test/_internal/provisioning.py
@@ -100,7 +100,7 @@ def prepare_profiles(
args: TEnvironmentConfig,
targets_use_pypi: bool = False,
skip_setup: bool = False,
- requirements: t.Optional[c.Callable[[TEnvironmentConfig, HostState], None]] = None,
+ requirements: t.Optional[c.Callable[[HostProfile], None]] = None,
) -> HostState:
"""
Create new profiles, or load existing ones, and return them.
@@ -140,7 +140,7 @@ def prepare_profiles(
check_controller_python(args, host_state)
if requirements:
- requirements(args, host_state)
+ requirements(host_state.controller_profile)
def configure(profile: HostProfile) -> None:
"""Configure the given profile."""
@@ -149,6 +149,9 @@ def prepare_profiles(
if not skip_setup:
profile.configure()
+ if requirements:
+ requirements(profile)
+
dispatch_jobs([(profile, WrappedThread(functools.partial(configure, profile))) for profile in host_state.target_profiles])
return host_state