Merge pull request #9646 from shanemcd/pdd-wrapper

Create a wrapper directory for the private data dir

Reviewed-by: None <None>
Reviewed-by: Ryan Petrello <None>
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-03-22 14:15:40 +00:00 committed by GitHub
commit 305f717e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -930,10 +930,17 @@ class BaseTask(object):
'''
Create a temporary directory for job-related files.
'''
path = tempfile.mkdtemp(prefix='awx_%s_' % instance.pk, dir=settings.AWX_PROOT_BASE_PATH)
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
pdd_wrapper_path = tempfile.mkdtemp(
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:
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')
if not os.path.exists(runner_project_folder):
# Ansible Runner requires that this directory exists.