summaryrefslogtreecommitdiffstats
path: root/roles/openshift_certificate_expiry
diff options
context:
space:
mode:
authorPierre-Louis Bonicoli <pierre-louis.bonicoli@libregerbil.fr>2017-04-05 14:46:24 +0200
committerPierre-Louis Bonicoli <pierre-louis.bonicoli@libregerbil.fr>2017-04-28 12:47:20 +0200
commit977947f68584faec9957d6d38ea5cdd38c5ea1b0 (patch)
tree920cbc8a3a491be99905a532abd6ae596c1fdbcb /roles/openshift_certificate_expiry
parentf6db43fa2ce74b8d05b81c188b7238fd88bc69b5 (diff)
downloadopenshift-977947f68584faec9957d6d38ea5cdd38c5ea1b0.tar.gz
openshift-977947f68584faec9957d6d38ea5cdd38c5ea1b0.tar.bz2
openshift-977947f68584faec9957d6d38ea5cdd38c5ea1b0.tar.xz
openshift-977947f68584faec9957d6d38ea5cdd38c5ea1b0.zip
Fix test compatibility with OpenSSL 1.1.0
Since OpenSSL 1.1.0, default name options ('oneline') for 'x509' command include 'space_eq'. Explicitly enable 'oneline' in order to have one behaviour with all versions.
Diffstat (limited to 'roles/openshift_certificate_expiry')
-rw-r--r--roles/openshift_certificate_expiry/library/openshift_cert_expiry.py4
-rw-r--r--roles/openshift_certificate_expiry/test/test_fakeopensslclasses.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py
index c204b5341..0242f5b43 100644
--- a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py
+++ b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py
@@ -135,7 +135,7 @@ platforms missing the Python OpenSSL library.
continue
elif l.startswith('Subject:'):
- # O=system:nodes, CN=system:node:m01.example.com
+ # O = system:nodes, CN = system:node:m01.example.com
self.subject = FakeOpenSSLCertificateSubjects(l.partition(': ')[-1])
def get_serial_number(self):
@@ -202,7 +202,7 @@ object"""
"""
self.subjects = []
for s in subject_string.split(', '):
- name, _, value = s.partition('=')
+ name, _, value = s.partition(' = ')
self.subjects.append((name, value))
def get_components(self):
diff --git a/roles/openshift_certificate_expiry/test/test_fakeopensslclasses.py b/roles/openshift_certificate_expiry/test/test_fakeopensslclasses.py
index ccdd48fa8..8a521a765 100644
--- a/roles/openshift_certificate_expiry/test/test_fakeopensslclasses.py
+++ b/roles/openshift_certificate_expiry/test/test_fakeopensslclasses.py
@@ -17,7 +17,8 @@ from openshift_cert_expiry import FakeOpenSSLCertificate # noqa: E402
@pytest.fixture(scope='module')
def fake_valid_cert(valid_cert):
- cmd = ['openssl', 'x509', '-in', str(valid_cert['cert_file']), '-text']
+ cmd = ['openssl', 'x509', '-in', str(valid_cert['cert_file']), '-text',
+ '-nameopt', 'oneline']
cert = subprocess.check_output(cmd)
return FakeOpenSSLCertificate(cert.decode('utf8'))