mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 17:07:36 -02:30
Fix previous change that broke getting the ssh_key_data from the job credential.
This commit is contained in:
@@ -65,14 +65,14 @@ class BaseTask(Task):
|
|||||||
Create a temporary file containing the SSH private key.
|
Create a temporary file containing the SSH private key.
|
||||||
'''
|
'''
|
||||||
ssh_key_data = ''
|
ssh_key_data = ''
|
||||||
if hasattr(instance, 'project'):
|
if hasattr(instance, 'credential'):
|
||||||
project = instance.project
|
|
||||||
if hasattr(project, 'scm_key_data'):
|
|
||||||
ssh_key_data = decrypt_field(project, 'scm_key_data')
|
|
||||||
elif hasattr(instance, 'credential'):
|
|
||||||
credential = instance.credential
|
credential = instance.credential
|
||||||
if hasattr(credential, 'ssh_key_data'):
|
if hasattr(credential, 'ssh_key_data'):
|
||||||
ssh_key_data = decrypt_field(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:
|
if ssh_key_data:
|
||||||
# FIXME: File permissions?
|
# FIXME: File permissions?
|
||||||
handle, path = tempfile.mkstemp()
|
handle, path = tempfile.mkstemp()
|
||||||
|
|||||||
Reference in New Issue
Block a user