This commit is contained in:
Maarten de Waard 2016-09-09 13:32:01 +02:00
parent 4a51180f4d
commit e17594e997
3 changed files with 7 additions and 3 deletions

View File

@ -26,6 +26,8 @@
Be sure to replace `$USER` with the user that will be running the lehaproxy Be sure to replace `$USER` with the user that will be running the lehaproxy
installer. installer.
""" """
from builtins import str
from past.builtins import basestring
import logging import logging
import os import os
import glob import glob
@ -134,7 +136,7 @@ class HAProxyInstaller(common.Plugin):
" returns letsencrypt certificates. Defaults to the value" " returns letsencrypt certificates. Defaults to the value"
" 'h2ppy h2cker fake CA' that is used by the local boulder." " 'h2ppy h2cker fake CA' that is used by the local boulder."
), ),
type=unicode, type=str,
default=u'Let\'s Encrypt Authority X3' default=u'Let\'s Encrypt Authority X3'
) )
add( add(
@ -464,7 +466,7 @@ class HAProxyInstaller(common.Plugin):
# Write all new files and changes: # Write all new files and changes:
for filepath, contents in \ 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 # Make sure directory of filepath exists
path = os.path.dirname(os.path.abspath(filepath)) path = os.path.dirname(os.path.abspath(filepath))

View File

@ -1,4 +1,5 @@
"""Test installer functions""" """Test installer functions"""
from past.builtins import basestring
import unittest import unittest
import mock import mock
import os import os
@ -75,7 +76,7 @@ class TestInstaller(unittest.TestCase):
from OpenSSL import crypto from OpenSSL import crypto
self.installer.new_crt_files = {} self.installer.new_crt_files = {}
self.installer._fall_back_cert() 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] cert = self.installer.new_crt_files[key]
self.assertIsInstance(key, str) self.assertIsInstance(key, str)
self.assertIsInstance(cert, str) self.assertIsInstance(cert, str)

View File

@ -1,6 +1,7 @@
""" """
Utility functions. Utility functions.
""" """
from builtins import object
from OpenSSL import crypto from OpenSSL import crypto
import socket import socket