summaryrefslogtreecommitdiff
path: root/test/lib/ansible_test/_internal/config.py
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2023-03-13 17:47:29 -0700
committerGitHub <noreply@github.com>2023-03-13 17:47:29 -0700
commitff91a95ef11acedd0ff8367143a882c72f7637ae (patch)
tree0ead93b1b3fd5f9f13643ce795f585d4f6ac136d /test/lib/ansible_test/_internal/config.py
parent57cd9447fe6594eb7b61a4fb47ba67b70f764bda (diff)
downloadansible-ff91a95ef11acedd0ff8367143a882c72f7637ae.tar.gz
[stable-2.14] ansible-test - Fix file permissions for delegation (#80203)
* [stable-2.14] ansible-test - Fix file permissions for delegation (#79932) * ansible-test - Fix file permissions for delegation * Set more restrictive permissions for SSH key * Check all execute bits, not just owner * Add a breaking_changes changelog entry (cherry picked from commit c8c1402) Co-authored-by: Matt Clay <matt@mystile.com> * ansible-test - Fix collection delegation (#79947) (cherry picked from commit 079383384790310dd6722b08ac18990e2a4d0ed9) --------- Co-authored-by: Felix Fontein <felix@fontein.de>
Diffstat (limited to 'test/lib/ansible_test/_internal/config.py')
-rw-r--r--test/lib/ansible_test/_internal/config.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/lib/ansible_test/_internal/config.py b/test/lib/ansible_test/_internal/config.py
index 372c23abb0..ea0e103dc7 100644
--- a/test/lib/ansible_test/_internal/config.py
+++ b/test/lib/ansible_test/_internal/config.py
@@ -24,6 +24,7 @@ from .metadata import (
from .data import (
data_context,
+ PayloadConfig,
)
from .host_configs import (
@@ -114,7 +115,7 @@ class EnvironmentConfig(CommonConfig):
self.dev_systemd_debug: bool = args.dev_systemd_debug
self.dev_probe_cgroups: t.Optional[str] = args.dev_probe_cgroups
- def host_callback(files: list[tuple[str, str]]) -> None:
+ def host_callback(payload_config: PayloadConfig) -> None:
"""Add the host files to the payload file list."""
config = self
@@ -123,6 +124,8 @@ class EnvironmentConfig(CommonConfig):
state_path = os.path.join(config.host_path, 'state.dat')
config_path = os.path.join(config.host_path, 'config.dat')
+ files = payload_config.files
+
files.append((os.path.abspath(settings_path), settings_path))
files.append((os.path.abspath(state_path), state_path))
files.append((os.path.abspath(config_path), config_path))
@@ -225,9 +228,10 @@ class TestConfig(EnvironmentConfig):
if self.coverage_check:
self.coverage = True
- def metadata_callback(files: list[tuple[str, str]]) -> None:
+ def metadata_callback(payload_config: PayloadConfig) -> None:
"""Add the metadata file to the payload file list."""
config = self
+ files = payload_config.files
if config.metadata_path:
files.append((os.path.abspath(config.metadata_path), config.metadata_path))
@@ -264,8 +268,10 @@ class SanityConfig(TestConfig):
self.display_stderr = self.lint or self.list_tests
if self.keep_git:
- def git_callback(files: list[tuple[str, str]]) -> None:
+ def git_callback(payload_config: PayloadConfig) -> None:
"""Add files from the content root .git directory to the payload file list."""
+ files = payload_config.files
+
for dirpath, _dirnames, filenames in os.walk(os.path.join(data_context().content.root, '.git')):
paths = [os.path.join(dirpath, filename) for filename in filenames]
files.extend((path, os.path.relpath(path, data_context().content.root)) for path in paths)