Fix test and bad domain error handling

This commit is contained in:
Brad Warren
2016-02-08 12:11:45 -08:00
parent 0ba4b0c0b5
commit 12f1ec6850
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -856,10 +856,10 @@ def _reconstitute(config, full_path):
try:
domains = [le_util.enforce_domain_sanity(x) for x in
renewal_candidate.names()]
except (UnicodeError, ValueError):
except errors.ConfigurationError as error:
logger.warning("Renewal configuration file %s references a cert "
"that mentions a domain name that we regarded as "
"invalid. Skipping.", full_path)
"that contains an invalid domain name. The problem "
"was: %s. Skipping.", full_path, error)
return None
setattr(config.namespace, "domains", domains)
+3 -3
View File
@@ -650,7 +650,7 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
mock_lineage = mock.MagicMock()
mock_rc.return_value = mock_lineage
mock_lineage.configuration = {
'renewalparams': {'authenticator': None,
'renewalparams': {'authenticator': 'webroot',
'rsa_key_size': 'over 9000'}}
with mock.patch('letsencrypt.cli.obtain_cert') as mock_obtain_cert:
self._test_renewal_common(True, None,
@@ -665,9 +665,9 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
with mock.patch('letsencrypt.storage.RenewableCert') as mock_rc:
mock_lineage = mock.MagicMock()
mock_rc.return_value = mock_lineage
mock_rc.names.return_value = ['*.example.com']
mock_lineage.configuration = {
'renewalparams': {'authenticator': None}}
'renewalparams': {'authenticator': 'webroot'}}
mock_lineage.names.return_value = ['*.example.com']
with mock.patch('letsencrypt.cli.obtain_cert') as mock_obtain_cert:
self._test_renewal_common(True, None,
args=['renew'], renew=False)