disable donation prompt during --quiet (#9022)

Issuing a certificate with --quiet was crashing during the donation
atexit call because it was trying to use the /dev/null fd after the
displayer context manager had already closed it.
This commit is contained in:
alexzorin 2021-09-08 01:38:27 +10:00 committed by GitHub
parent b7bde05aee
commit 70a18a9486
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -27,6 +27,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
### Fixed
* Fixed parsing of `Define`d values in the Apache plugin to allow for `=` in the value.
* Fixed a relatively harmless crash when issuing a certificate with `--quiet`/`-q`.
More details about these changes can be found on our GitHub repo.

View file

@ -66,9 +66,12 @@ def _suggest_donation_if_appropriate(config):
:rtype: None
"""
# don't prompt for donation if:
# - renewing
# - using the staging server (--staging or --dry-run)
# - running with --quiet (display fd won't be available during atexit calls #8995)
assert config.verb != "renew"
if config.staging:
# --dry-run implies --staging
if config.staging or config.quiet:
return
util.atexit_register(
display_util.notification,