This commit is contained in:
Maarten de Waard 2016-09-09 13:29:51 +02:00
parent 52ee2c7519
commit 4a51180f4d
2 changed files with 4 additions and 3 deletions

View File

@ -523,7 +523,7 @@ class HAProxyInstaller(common.Plugin):
contents = pem.read()
if self._cert_key_check(contents, filepath):
yield (filepath, filepath, self.conf("haproxy-config"))
except IOError, err:
except IOError as err:
logger.error(
"Can't access \"%s\", reason:\n %s",
filepath,
@ -544,7 +544,7 @@ class HAProxyInstaller(common.Plugin):
except TypeError:
logger.warn("Could not read certificate, wrong type (not PEM)")
# Documentation says it raises "Error"
except Exception, err: # pylint: disable=broad-except
except Exception as err: # pylint: disable=broad-except
logger.error("Unexpected error! %s", err)
if issuer == self.conf('haproxy-ca-common-name') and key.check():

View File

@ -1,4 +1,5 @@
"""Certbot HAProxy Tests"""
from __future__ import print_function
import unittest
@ -6,7 +7,7 @@ def load_tests(loader, tests, pattern=None):
"""Find all python files in the tests folder"""
if pattern is None:
pattern = 'test_*.py'
print "loader: ", loader
print("loader: ", loader)
suite = loader.discover('certbot_haproxy/tests', pattern=pattern)
suite.addTests(tests)