From 612147e3557504c7c0ad026c51d405fe9fadbf08 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Sun, 26 Apr 2015 10:58:15 -0400 Subject: [PATCH 1/2] return empty private data content rather than None for generate private file method --- awx/main/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index adf60f9516..b6256660d3 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -768,7 +768,7 @@ class RunProjectUpdate(BaseTask): ''' private_data = {} if project_update.credential: - private_data['scm_credential'] = decrypt_field(project_update.credential, 'ssh_key_data') or None + private_data['scm_credential'] = decrypt_field(project_update.credential, 'ssh_key_data') return private_data def build_passwords(self, project_update, **kwargs): From b323e26b2ff1b0e23dc931ed54a53e8ef2c611d8 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Sun, 26 Apr 2015 20:03:48 -0400 Subject: [PATCH 2/2] do not generate scm private key file if no ssh data associated with credential --- awx/main/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index b6256660d3..ddb0d509e3 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -768,7 +768,9 @@ class RunProjectUpdate(BaseTask): ''' private_data = {} if project_update.credential: - private_data['scm_credential'] = decrypt_field(project_update.credential, 'ssh_key_data') + credential = project_update.credential + if credential.ssh_key_data not in (None, ''): + private_data['scm_credential'] = decrypt_field(project_update.credential, 'ssh_key_data') return private_data def build_passwords(self, project_update, **kwargs):