Skip to content

Commit

Permalink
Merge pull request #4415 from ryanpetrello/bubblewrap_aaaaaaaaaaarg
Browse files Browse the repository at this point in the history
fix a bug that breaks isolated task execution

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
  • Loading branch information
2 parents 9d2549b + 1388dec commit bb2474f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions awx/main/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,14 @@ def build_params_process_isolation(self, instance, private_data_dir, cwd):
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,
Expand Down
2 changes: 2 additions & 0 deletions awx/main/tests/unit/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ def test_uses_process_isolation(self, settings):
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'
Expand Down Expand Up @@ -1701,6 +1702,7 @@ def project_update(self):
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(
Expand Down

0 comments on commit bb2474f

Please sign in to comment.