Finished basic crash recovery

This commit is contained in:
Brad Warren
2015-09-23 15:02:20 -07:00
parent aa216a96d4
commit 2b9f72fc29
6 changed files with 82 additions and 27 deletions
+3 -7
View File
@@ -11,6 +11,7 @@ from acme import messages
from letsencrypt import achallenges
from letsencrypt import constants
from letsencrypt import errors
from letsencrypt import error_handler
from letsencrypt import interfaces
@@ -106,17 +107,12 @@ class AuthHandler(object):
"""Get Responses for challenges from authenticators."""
cont_resp = []
dv_resp = []
try:
logger.info("Attempting to set up challenges.")
with error_handler.ErrorHandler(self._cleanup_challenges):
if self.cont_c:
cont_resp = self.cont_auth.perform(self.cont_c)
if self.dv_c:
dv_resp = self.dv_auth.perform(self.dv_c)
# This will catch both specific types of errors.
except errors.AuthorizationError:
logger.critical("Failure in setting up challenges.")
logger.info("Attempting to clean up outstanding challenges...")
self._cleanup_challenges()
raise
assert len(cont_resp) == len(self.cont_c)
assert len(dv_resp) == len(self.dv_c)