Skip to content

Commit

Permalink
Fix authorization status checker to check the last request before Sto…
Browse files Browse the repository at this point in the history
…pIteration (#148)

* Fix authorization status break condition

* Update CONTRIBUTORS.md

* Fix formatting
  • Loading branch information
rozgonik authored Mar 15, 2020
1 parent dbee725 commit 43c3c8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Contributors
9. [@etienne-napoleone](https://github.com/etienne-napoleone)
10. [@soloradish](https://github.com/soloradish)
11. [Moritz Ulmer](https://www.protohaus.org)
12. [rozgonik](https://github.com/rozgonik)
5 changes: 2 additions & 3 deletions sewer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ def check_authorization_status(self, authorization_url, desired_status=None):
self.log_response(check_authorization_status_response),
)
)
if authorization_status in desired_status:
break
if number_of_checks == self.ACME_AUTH_STATUS_MAX_CHECKS:
raise StopIteration(
"Checks done={0}. Max checks allowed={1}. Interval between checks={2}seconds.".format(
Expand All @@ -487,9 +489,6 @@ def check_authorization_status(self, authorization_url, desired_status=None):
)
)

if authorization_status in desired_status:
break

self.logger.info("check_authorization_status_success")
return check_authorization_status_response

Expand Down

0 comments on commit 43c3c8e

Please # to comment.