mirror of
https://github.com/certbot/certbot.git
synced 2026-07-29 09:26:23 +02:00
Remove superfluous except: and change Exception returned if dnspython is not
available.
This commit is contained in:
@@ -246,8 +246,8 @@ class DNS01Response(KeyAuthorizationChallengeResponse):
|
||||
txt_records = dns_resolver.txt_records_for_name(
|
||||
validation_domain_name)
|
||||
except ImportError: # pragma: no cover
|
||||
raise ImportError("Local validation for 'dns-01' challenges "
|
||||
"requires 'dnspython'")
|
||||
raise errors.Error("Local validation for 'dns-01' challenges "
|
||||
"requires 'dnspython'")
|
||||
exists = validation in txt_records
|
||||
if not exists:
|
||||
logger.debug("Key authorization from response (%r) doesn't match "
|
||||
|
||||
@@ -19,9 +19,6 @@ def txt_records_for_name(name):
|
||||
"""
|
||||
try:
|
||||
dns_response = dns.resolver.query(name, 'TXT')
|
||||
except ImportError as error: # pragma: no cover
|
||||
raise ImportError("Local validation for 'dns-01' challenges requires "
|
||||
"'dnspython'")
|
||||
except dns.exception.DNSException as error:
|
||||
logger.error("Unable to resolve %s: %s", name, str(error))
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user