mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 16:19:13 +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:
|
try:
|
||||||
domains = [le_util.enforce_domain_sanity(x) for x in
|
domains = [le_util.enforce_domain_sanity(x) for x in
|
||||||
renewal_candidate.names()]
|
renewal_candidate.names()]
|
||||||
except (UnicodeError, ValueError):
|
except errors.ConfigurationError as error:
|
||||||
logger.warning("Renewal configuration file %s references a cert "
|
logger.warning("Renewal configuration file %s references a cert "
|
||||||
"that mentions a domain name that we regarded as "
|
"that contains an invalid domain name. The problem "
|
||||||
"invalid. Skipping.", full_path)
|
"was: %s. Skipping.", full_path, error)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
setattr(config.namespace, "domains", domains)
|
setattr(config.namespace, "domains", domains)
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
|||||||
mock_lineage = mock.MagicMock()
|
mock_lineage = mock.MagicMock()
|
||||||
mock_rc.return_value = mock_lineage
|
mock_rc.return_value = mock_lineage
|
||||||
mock_lineage.configuration = {
|
mock_lineage.configuration = {
|
||||||
'renewalparams': {'authenticator': None,
|
'renewalparams': {'authenticator': 'webroot',
|
||||||
'rsa_key_size': 'over 9000'}}
|
'rsa_key_size': 'over 9000'}}
|
||||||
with mock.patch('letsencrypt.cli.obtain_cert') as mock_obtain_cert:
|
with mock.patch('letsencrypt.cli.obtain_cert') as mock_obtain_cert:
|
||||||
self._test_renewal_common(True, None,
|
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:
|
with mock.patch('letsencrypt.storage.RenewableCert') as mock_rc:
|
||||||
mock_lineage = mock.MagicMock()
|
mock_lineage = mock.MagicMock()
|
||||||
mock_rc.return_value = mock_lineage
|
mock_rc.return_value = mock_lineage
|
||||||
mock_rc.names.return_value = ['*.example.com']
|
|
||||||
mock_lineage.configuration = {
|
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:
|
with mock.patch('letsencrypt.cli.obtain_cert') as mock_obtain_cert:
|
||||||
self._test_renewal_common(True, None,
|
self._test_renewal_common(True, None,
|
||||||
args=['renew'], renew=False)
|
args=['renew'], renew=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user