diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 63e597ef0c..1a6e0f25c1 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1307,7 +1307,7 @@ class RunProjectUpdate(BaseTask): } } ''' - handle, self.revision_path = tempfile.mkstemp(dir=settings.AWX_PROOT_BASE_PATH) + handle, self.revision_path = tempfile.mkstemp(dir=settings.PROJECTS_ROOT) self.cleanup_paths.append(self.revision_path) private_data = {'credentials': {}} if project_update.credential: diff --git a/awx/main/tests/unit/test_tasks.py b/awx/main/tests/unit/test_tasks.py index 6038440357..bbc52fad8d 100644 --- a/awx/main/tests/unit/test_tasks.py +++ b/awx/main/tests/unit/test_tasks.py @@ -181,6 +181,8 @@ class TestJobExecution: EXAMPLE_PRIVATE_KEY = '-----BEGIN PRIVATE KEY-----\nxyz==\n-----END PRIVATE KEY-----' def setup_method(self, method): + if not os.path.exists(settings.PROJECTS_ROOT): + os.mkdir(settings.PROJECTS_ROOT) self.project_path = tempfile.mkdtemp(prefix='awx_project_') with open(os.path.join(self.project_path, 'helloworld.yml'), 'w') as f: f.write('---') @@ -1124,6 +1126,7 @@ class TestProjectUpdateCredentials(TestJobExecution): settings.PROJECTS_ROOT, settings.PROJECTS_ROOT, ]) in ' '.join(args) + assert '"scm_revision_output": "/projects/tmp' in ' '.join(args) def test_username_and_password_auth(self, scm_type): ssh = CredentialType.defaults['ssh']()