mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03:30
Merge pull request #4409 from ryanpetrello/bubblewrap_aaaaaaaaaaarg
attempt to properly clean up orphaned runner ansible_pi directories Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
008ea30c5f
@ -864,9 +864,17 @@ class BaseTask(object):
|
||||
# Help the user out by including the collections path inside the bubblewrap environment
|
||||
if getattr(settings, 'AWX_ANSIBLE_COLLECTIONS_PATHS', []):
|
||||
show_paths.extend(settings.AWX_ANSIBLE_COLLECTIONS_PATHS)
|
||||
|
||||
pi_path = tempfile.mkdtemp(
|
||||
prefix='ansible_runner_pi_',
|
||||
dir=settings.AWX_PROOT_BASE_PATH
|
||||
)
|
||||
os.chmod(pi_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
||||
self.cleanup_paths.append(pi_path)
|
||||
|
||||
process_isolation_params = {
|
||||
'process_isolation': True,
|
||||
'process_isolation_path': settings.AWX_PROOT_BASE_PATH,
|
||||
'process_isolation_path': pi_path,
|
||||
'process_isolation_show_paths': show_paths,
|
||||
'process_isolation_hide_paths': [
|
||||
settings.AWX_PROOT_BASE_PATH,
|
||||
|
||||
@ -445,7 +445,7 @@ class TestGenericRun():
|
||||
|
||||
process_isolation_params = task.build_params_process_isolation(job, private_data_dir, cwd)
|
||||
assert True is process_isolation_params['process_isolation']
|
||||
assert settings.AWX_PROOT_BASE_PATH == process_isolation_params['process_isolation_path'], \
|
||||
assert process_isolation_params['process_isolation_path'].startswith(settings.AWX_PROOT_BASE_PATH), \
|
||||
"Directory where a temp directory will be created for the remapping to take place"
|
||||
assert private_data_dir in process_isolation_params['process_isolation_show_paths'], \
|
||||
"The per-job private data dir should be in the list of directories the user can see."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user