remove hard coded "/tmp" in ansible-test injector paths

pull/84316/head
simonLeary42 1 week ago committed by GitHub
parent 3e82ed307b
commit 7a19347550
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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.

Loading…
Cancel
Save