mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03:30
fix a bug that breaks isolated task execution
This commit is contained in:
parent
9d2549b4b1
commit
1388dec4b0
@ -865,12 +865,14 @@ class BaseTask(object):
|
||||
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)
|
||||
pi_path = settings.AWX_PROOT_BASE_PATH
|
||||
if not self.instance.is_isolated():
|
||||
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,
|
||||
|
||||
@ -434,6 +434,7 @@ class TestGenericRun():
|
||||
job = Job(project=Project(), inventory=Inventory())
|
||||
task = tasks.RunJob()
|
||||
task.should_use_proot = lambda instance: True
|
||||
task.instance = job
|
||||
|
||||
private_data_dir = '/foo'
|
||||
cwd = '/bar'
|
||||
@ -1701,6 +1702,7 @@ class TestProjectUpdateCredentials(TestJobExecution):
|
||||
def test_process_isolation_exposes_projects_root(self, private_data_dir, project_update):
|
||||
task = tasks.RunProjectUpdate()
|
||||
task.revision_path = 'foobar'
|
||||
task.instance = project_update
|
||||
ssh = CredentialType.defaults['ssh']()
|
||||
project_update.scm_type = 'git'
|
||||
project_update.credential = Credential(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user