mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
write the scm_revision_output to the project path instead of /tmp
see: https://github.com/ansible/ansible-tower/issues/7558
This commit is contained in:
@@ -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)
|
self.cleanup_paths.append(self.revision_path)
|
||||||
private_data = {'credentials': {}}
|
private_data = {'credentials': {}}
|
||||||
if project_update.credential:
|
if project_update.credential:
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ class TestJobExecution:
|
|||||||
EXAMPLE_PRIVATE_KEY = '-----BEGIN PRIVATE KEY-----\nxyz==\n-----END PRIVATE KEY-----'
|
EXAMPLE_PRIVATE_KEY = '-----BEGIN PRIVATE KEY-----\nxyz==\n-----END PRIVATE KEY-----'
|
||||||
|
|
||||||
def setup_method(self, method):
|
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_')
|
self.project_path = tempfile.mkdtemp(prefix='awx_project_')
|
||||||
with open(os.path.join(self.project_path, 'helloworld.yml'), 'w') as f:
|
with open(os.path.join(self.project_path, 'helloworld.yml'), 'w') as f:
|
||||||
f.write('---')
|
f.write('---')
|
||||||
@@ -1124,6 +1126,7 @@ class TestProjectUpdateCredentials(TestJobExecution):
|
|||||||
settings.PROJECTS_ROOT,
|
settings.PROJECTS_ROOT,
|
||||||
settings.PROJECTS_ROOT,
|
settings.PROJECTS_ROOT,
|
||||||
]) in ' '.join(args)
|
]) in ' '.join(args)
|
||||||
|
assert '"scm_revision_output": "/projects/tmp' in ' '.join(args)
|
||||||
|
|
||||||
def test_username_and_password_auth(self, scm_type):
|
def test_username_and_password_auth(self, scm_type):
|
||||||
ssh = CredentialType.defaults['ssh']()
|
ssh = CredentialType.defaults['ssh']()
|
||||||
|
|||||||
Reference in New Issue
Block a user