1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-05 05:51:21 +03:00

Fix previous change that broke getting the ssh_key_data from the job credential.

This commit is contained in:
Chris Church 2013-09-07 20:00:59 -04:00
parent 663dfa24a2
commit 3a56ff7cec

View File

@ -65,14 +65,14 @@ class BaseTask(Task):
Create a temporary file containing the SSH private key.
'''
ssh_key_data = ''
if hasattr(instance, 'project'):
project = instance.project
if hasattr(project, 'scm_key_data'):
ssh_key_data = decrypt_field(project, 'scm_key_data')
elif hasattr(instance, 'credential'):
if hasattr(instance, 'credential'):
credential = instance.credential
if hasattr(credential, 'ssh_key_data'):
ssh_key_data = decrypt_field(credential, 'ssh_key_data')
elif hasattr(instance, 'project'):
project = instance.project
if hasattr(project, 'scm_key_data'):
ssh_key_data = decrypt_field(project, 'scm_key_data')
if ssh_key_data:
# FIXME: File permissions?
handle, path = tempfile.mkstemp()