mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Ignore unknown challenge types
This commit is contained in:
parent
a70134a5c8
commit
ab98d5c39f
1 changed files with 11 additions and 1 deletions
|
|
@ -373,7 +373,17 @@ class Authorization(ResourceBody):
|
|||
|
||||
@challenges.decoder
|
||||
def challenges(value): # pylint: disable=missing-docstring,no-self-argument
|
||||
return tuple(ChallengeBody.from_json(chall) for chall in value)
|
||||
# The from_json method raises errors.UnrecognizedTypeError when a
|
||||
# challenge of unknown type is encountered. We want to ignore this
|
||||
# case. This forces us to do an explicit iteration, since list
|
||||
# comprehensions can't handle exceptions.
|
||||
challenges = []
|
||||
for chall in value:
|
||||
try:
|
||||
challenges.append(ChallengeBody.from_json(chall))
|
||||
except errors.UnknownTypeError:
|
||||
continue
|
||||
return tuple(challenges)
|
||||
|
||||
@property
|
||||
def resolved_combinations(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue