mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 19:31:51 +02:00
Verbosity tuning
This commit is contained in:
+13
-13
@@ -203,12 +203,12 @@ def should_renew(config, lineage):
|
|||||||
def _renew_describe_results(config, renew_successes, renew_failures,
|
def _renew_describe_results(config, renew_successes, renew_failures,
|
||||||
renew_skipped, parse_failures):
|
renew_skipped, parse_failures):
|
||||||
def notify(msg):
|
def notify(msg):
|
||||||
"Our version of print()"
|
"A variant of print() that is silenced by -q"
|
||||||
zope.component.getUtility(interfaces.IDisplay).notification(msg, pause=False)
|
zope.component.getUtility(interfaces.IDisplay).notification(msg, pause=False)
|
||||||
|
|
||||||
def report(msgs, category):
|
def report(msgs, category):
|
||||||
"Report results for a category of renewal outcomes"
|
"Report results for a category of renewal outcomes"
|
||||||
notify(" " + "\n ".join("%s (%s)" % (m, category) for m in msgs))
|
return " " + "\n ".join("%s (%s)" % (m, category) for m in msgs)
|
||||||
|
|
||||||
if config.dry_run:
|
if config.dry_run:
|
||||||
notify("** DRY RUN: simulating 'letsencrypt renew' close to cert expiry")
|
notify("** DRY RUN: simulating 'letsencrypt renew' close to cert expiry")
|
||||||
@@ -216,27 +216,27 @@ def _renew_describe_results(config, renew_successes, renew_failures,
|
|||||||
notify("")
|
notify("")
|
||||||
if renew_skipped:
|
if renew_skipped:
|
||||||
notify("The following certs are not due for renewal yet:")
|
notify("The following certs are not due for renewal yet:")
|
||||||
report(renew_skipped, "skipped")
|
notify(report(renew_skipped, "skipped"))
|
||||||
if not renew_successes and not renew_failures:
|
if not renew_successes and not renew_failures:
|
||||||
notify("No renewals were attempted.")
|
notify("No renewals were attempted.")
|
||||||
elif renew_successes and not renew_failures:
|
elif renew_successes and not renew_failures:
|
||||||
notify("Congratulations, all renewals succeeded. The following certs "
|
notify("Congratulations, all renewals succeeded. The following certs "
|
||||||
"have been renewed:")
|
"have been renewed:")
|
||||||
report(renew_successes, "success")
|
notify(report(renew_successes, "success"))
|
||||||
elif renew_failures and not renew_successes:
|
elif renew_failures and not renew_successes:
|
||||||
notify("All renewal attempts failed. The following certs could not be "
|
logger.error("All renewal attempts failed. The following certs could not be "
|
||||||
"renewed:")
|
"renewed:")
|
||||||
report(renew_failures, "failure")
|
logger.error(report(renew_failures, "failure"))
|
||||||
elif renew_failures and renew_successes:
|
elif renew_failures and renew_successes:
|
||||||
notify("The following certs were successfully renewed:")
|
logger.error("The following certs were successfully renewed:")
|
||||||
report(renew_successes, "success")
|
logger.error(report(renew_successes, "success"))
|
||||||
notify("\nThe following certs could not be renewed:")
|
logger.error("\nThe following certs could not be renewed:")
|
||||||
report(renew_failures, "failure")
|
logger.error(renew_failures, "failure")
|
||||||
|
|
||||||
if parse_failures:
|
if parse_failures:
|
||||||
notify("\nAdditionally, the following renewal configuration files "
|
logger.error("\nAdditionally, the following renewal configuration files "
|
||||||
"were invalid: ")
|
"were invalid: ")
|
||||||
report(parse_failures, "parsefail")
|
logger.error(parse_failures, "parsefail")
|
||||||
|
|
||||||
if config.dry_run:
|
if config.dry_run:
|
||||||
notify("** DRY RUN: simulating 'letsencrypt renew' close to cert expiry")
|
notify("** DRY RUN: simulating 'letsencrypt renew' close to cert expiry")
|
||||||
|
|||||||
Reference in New Issue
Block a user