From 3a56ff7cec772f4d91b814e42403b1036e07491d Mon Sep 17 00:00:00 2001 From: Chris Church Date: Sat, 7 Sep 2013 20:00:59 -0400 Subject: [PATCH] Fix previous change that broke getting the ssh_key_data from the job credential. --- awx/main/tasks.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 5da71038a8..ee34c95604 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -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()