From 7deaed5205d0db6139f1c5e1f7c2b72181b1a208 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Mon, 7 Sep 2020 23:54:47 -0400 Subject: Run futurize on the codebase for python3 --- jobs/TLSCertExpiration.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'jobs/TLSCertExpiration.py') diff --git a/jobs/TLSCertExpiration.py b/jobs/TLSCertExpiration.py index e4b05b7..e0fb689 100755 --- a/jobs/TLSCertExpiration.py +++ b/jobs/TLSCertExpiration.py @@ -1,14 +1,18 @@ #!/usr/bin/env python +from __future__ import absolute_import +from future import standard_library +standard_library.install_aliases() +from builtins import str import ssl import time import logging -import httplib +import http.client import OpenSSL import datetime -import JobBase -import JobSpawner +from . import JobBase +from . import JobSpawner class TLSCertExpiration(JobSpawner.JobSpawner): servers = [ @@ -35,7 +39,7 @@ class TLSCertExpiration(JobSpawner.JobSpawner): def execute(self): try: context = ssl._create_unverified_context() - c = httplib.HTTPSConnection(self.url, context=context) + c = http.client.HTTPSConnection(self.url, context=context) c.request("GET", "/") asn1 = c.sock.getpeercert(True) x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_ASN1, asn1) -- cgit v1.2.3