From 7a19347550ec491860e2259197fe40d24556d7ed Mon Sep 17 00:00:00 2001 From: simonLeary42 <71396965+simonLeary42@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:25:19 -0500 Subject: [PATCH] remove hard coded "/tmp" in ansible-test injector paths --- test/lib/ansible_test/_internal/util_common.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/lib/ansible_test/_internal/util_common.py b/test/lib/ansible_test/_internal/util_common.py index 98d9c23965b..ba4a3e41eb8 100644 --- a/test/lib/ansible_test/_internal/util_common.py +++ b/test/lib/ansible_test/_internal/util_common.py @@ -296,7 +296,7 @@ def write_text_test_results(category: ResultType, name: str, content: str) -> No @cache def get_injector_path() -> str: """Return the path to a directory which contains a `python.py` executable and associated injector scripts.""" - injector_path = tempfile.mkdtemp(prefix='ansible-test-', suffix='-injector', dir='/tmp') + injector_path = tempfile.mkdtemp(prefix='ansible-test-', suffix='-injector') display.info(f'Initializing "{injector_path}" as the temporary injector directory.', verbosity=1) @@ -370,9 +370,7 @@ def get_python_path(interpreter: str) -> str: prefix = 'python-' suffix = '-ansible' - root_temp_dir = '/tmp' - - python_path = tempfile.mkdtemp(prefix=prefix, suffix=suffix, dir=root_temp_dir) + python_path = tempfile.mkdtemp(prefix=prefix, suffix=suffix) injected_interpreter = os.path.join(python_path, 'python') # A symlink is faster than the execv wrapper, but isn't guaranteed to provide the correct result.