mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 13:59:02 -04:00
Remove superfluous except: and change Exception returned if dnspython is not
available.
This commit is contained in:
parent
266dc9535a
commit
02a493011e
2 changed files with 2 additions and 5 deletions
|
|
@ -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 []
|
||||
|
|
|
|||
Loading…
Reference in a new issue