Handle missing dnspython by displaying a warning message

This commit is contained in:
Mathieu Leduc-Hamel
2016-08-18 21:41:33 -04:00
parent 075e666300
commit 9958a7fc1c
4 changed files with 29 additions and 4 deletions
+2 -2
View File
@@ -234,8 +234,8 @@ class DNS01Response(KeyAuthorizationChallengeResponse):
try:
from acme import dns_resolver
except ImportError: # pragma: no cover
raise errors.Error("Local validation for 'dns-01' challenges "
"requires 'dnspython'")
raise errors.DependencyError("Local validation for 'dns-01' "
"challenges requires 'dnspython'")
txt_records = dns_resolver.txt_records_for_name(validation_domain_name)
exists = validation in txt_records
if not exists:
+4
View File
@@ -6,6 +6,10 @@ class Error(Exception):
"""Generic ACME error."""
class DependencyError(Error):
"""Dependency error"""
class SchemaValidationError(jose_errors.DeserializationError):
"""JSON schema ACME object validation error."""