mirror of
https://github.com/certbot/certbot.git
synced 2026-06-06 23:32:06 -04:00
Convert two assertions to exceptions
This commit is contained in:
parent
41284ffc0a
commit
ef34c06c8f
1 changed files with 6 additions and 2 deletions
|
|
@ -458,7 +458,9 @@ class StandaloneAuthenticator(object):
|
|||
raise Exception(".perform() was called with pending tasks!")
|
||||
results_if_success = []
|
||||
results_if_failure = []
|
||||
assert chall_list
|
||||
if not chall_list or not isinstance(chall_list, list):
|
||||
# TODO: Specify a correct exception subclass.
|
||||
raise Exception(".perform() was called without challenge list")
|
||||
for chall in chall_list:
|
||||
if isinstance(chall, DvsniChall):
|
||||
# We will attempt to do it
|
||||
|
|
@ -473,7 +475,9 @@ class StandaloneAuthenticator(object):
|
|||
# is not a type we can handle
|
||||
results_if_success.append(False)
|
||||
results_if_failure.append(False)
|
||||
assert self.tasks
|
||||
if not self.tasks:
|
||||
# TODO: Specify a correct exception subclass.
|
||||
raise Exception("nothing for .perform() to do")
|
||||
# Try to do the authentication; note that this creates
|
||||
# the listener subprocess via os.fork()
|
||||
if self.start_listener(CONFIG.PORT, key):
|
||||
|
|
|
|||
Loading…
Reference in a new issue