Create a wrapper directory for the private data dir

This commit is contained in:
Shane McDonald
2021-03-22 09:24:48 -04:00
parent 597435141d
commit fd63937fa2

View File

@@ -930,10 +930,17 @@ class BaseTask(object):
''' '''
Create a temporary directory for job-related files. Create a temporary directory for job-related files.
''' '''
path = tempfile.mkdtemp(prefix='awx_%s_' % instance.pk, dir=settings.AWX_PROOT_BASE_PATH) pdd_wrapper_path = tempfile.mkdtemp(
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) prefix=f'pdd_wrapper_{instance.pk}_',
dir=settings.AWX_PROOT_BASE_PATH
)
os.chmod(pdd_wrapper_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
if settings.AWX_CLEANUP_PATHS: if settings.AWX_CLEANUP_PATHS:
self.cleanup_paths.append(path) self.cleanup_paths.append(pdd_wrapper_path)
path = tempfile.mkdtemp(prefix='awx_%s_' % instance.pk,
dir=pdd_wrapper_path)
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
runner_project_folder = os.path.join(path, 'project') runner_project_folder = os.path.join(path, 'project')
if not os.path.exists(runner_project_folder): if not os.path.exists(runner_project_folder):
# Ansible Runner requires that this directory exists. # Ansible Runner requires that this directory exists.