From 49d689fdb2cb86c82d77e65081a6b0c0e07dadcf Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Mon, 4 Aug 2014 09:28:29 -0500 Subject: [PATCH] Fix cert regex. This makes the certificate not have to be at the beginning of the regex for the SSH key. --- awx/main/models/credential.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/models/credential.py b/awx/main/models/credential.py index bc0917ca65..b358be65a3 100644 --- a/awx/main/models/credential.py +++ b/awx/main/models/credential.py @@ -214,8 +214,8 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique): # Sanity check: We may potentially receive a full PEM certificate, # and we want to accept these. - cert_begin_re = r'^(-{4,})\s*BEGIN\s+CERTIFICATE\s*(-{4,})' - cert_end_re = r'^(-{4,})\s*END\s+CERTIFICATE\s*(-{4,})' + cert_begin_re = r'(-{4,})\s*BEGIN\s+CERTIFICATE\s*(-{4,})' + cert_end_re = r'(-{4,})\s*END\s+CERTIFICATE\s*(-{4,})' cert_begin_match = re.search(cert_begin_re, data) if cert_begin_match: cert_end_match = re.search(cert_end_re, data)