mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 16:15:42 +02:00
Fix test and bad domain error handling
This commit is contained in:
+3
-3
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user