diff --git a/certbot_haproxy/installer.py b/certbot_haproxy/installer.py index 47eb149..28c5fa4 100644 --- a/certbot_haproxy/installer.py +++ b/certbot_haproxy/installer.py @@ -26,6 +26,8 @@ Be sure to replace `$USER` with the user that will be running the lehaproxy installer. """ +from builtins import str +from past.builtins import basestring import logging import os import glob @@ -134,7 +136,7 @@ class HAProxyInstaller(common.Plugin): " returns letsencrypt certificates. Defaults to the value" " 'h2ppy h2cker fake CA' that is used by the local boulder." ), - type=unicode, + type=str, default=u'Let\'s Encrypt Authority X3' ) add( @@ -464,7 +466,7 @@ class HAProxyInstaller(common.Plugin): # Write all new files and changes: for filepath, contents in \ - self.new_crt_files.items() + self.crt_files.items(): + list(self.new_crt_files.items()) + list(self.crt_files.items()): # Make sure directory of filepath exists path = os.path.dirname(os.path.abspath(filepath)) diff --git a/certbot_haproxy/tests/test_installer.py b/certbot_haproxy/tests/test_installer.py index 7a849c4..b609686 100644 --- a/certbot_haproxy/tests/test_installer.py +++ b/certbot_haproxy/tests/test_installer.py @@ -1,4 +1,5 @@ """Test installer functions""" +from past.builtins import basestring import unittest import mock import os @@ -75,7 +76,7 @@ class TestInstaller(unittest.TestCase): from OpenSSL import crypto self.installer.new_crt_files = {} self.installer._fall_back_cert() - key = self.installer.new_crt_files.keys()[0] + key = list(self.installer.new_crt_files.keys())[0] cert = self.installer.new_crt_files[key] self.assertIsInstance(key, str) self.assertIsInstance(cert, str) diff --git a/certbot_haproxy/util.py b/certbot_haproxy/util.py index a55483c..2d388ed 100644 --- a/certbot_haproxy/util.py +++ b/certbot_haproxy/util.py @@ -1,6 +1,7 @@ """ Utility functions. """ +from builtins import object from OpenSSL import crypto import socket