Refactor main (#4127)

* Refactor main to simplify logic

* Update tests and comments

* Correct main test

* increase timeout limit

* reset timeout limit

* call renew_cert in appropriate main test

* Update docstrings and revert signatures of _report_new_cert and _suggest_donation_of_appropriate

* replace renew_cert logic

* update tests

* rename _csr_obtain_cert and add a check to _report_new_cert
This commit is contained in:
Erica Portnoy
2017-02-22 13:08:56 -08:00
committed by Brad Warren
parent ebf5170d12
commit 5bab6b512f
5 changed files with 187 additions and 130 deletions
+6 -1
View File
@@ -410,7 +410,12 @@ def handle_renewal_request(config):
if should_renew(lineage_config, renewal_candidate):
plugins = plugins_disco.PluginsRegistry.find_all()
from certbot import main
main.obtain_cert(lineage_config, plugins, renewal_candidate)
# domains have been restored into lineage_config by reconstitute
# but they're unnecessary anyway because renew_cert here
# will just grab them from the certificate
# we already know it's time to renew based on should_renew
# and we have a lineage in renewal_candidate
main.renew_cert(lineage_config, plugins, renewal_candidate)
renew_successes.append(renewal_candidate.fullchain)
else:
renew_skipped.append(renewal_candidate.fullchain)