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:
parent
663dfa24a2
commit
3a56ff7cec
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user