mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 00:22:28 +02:00
Add --dry-run support when renewing a lineage
This commit is contained in:
+7
-6
@@ -404,12 +404,13 @@ def _auth_from_domains(le_client, config, domains):
|
|||||||
# https://github.com/letsencrypt/letsencrypt/pull/777/files#r40498574
|
# https://github.com/letsencrypt/letsencrypt/pull/777/files#r40498574
|
||||||
new_certr, new_chain, new_key, _ = le_client.obtain_certificate(domains)
|
new_certr, new_chain, new_key, _ = le_client.obtain_certificate(domains)
|
||||||
# TODO: Check whether it worked! <- or make sure errors are thrown (jdk)
|
# TODO: Check whether it worked! <- or make sure errors are thrown (jdk)
|
||||||
lineage.save_successor(
|
if not config.dry_run:
|
||||||
lineage.latest_common_version(), OpenSSL.crypto.dump_certificate(
|
lineage.save_successor(
|
||||||
OpenSSL.crypto.FILETYPE_PEM, new_certr.body.wrapped),
|
lineage.latest_common_version(), OpenSSL.crypto.dump_certificate(
|
||||||
new_key.pem, crypto_util.dump_pyopenssl_chain(new_chain))
|
OpenSSL.crypto.FILETYPE_PEM, new_certr.body.wrapped),
|
||||||
|
new_key.pem, crypto_util.dump_pyopenssl_chain(new_chain))
|
||||||
|
|
||||||
lineage.update_all_links_to(lineage.latest_common_version())
|
lineage.update_all_links_to(lineage.latest_common_version())
|
||||||
# TODO: Check return value of save_successor
|
# TODO: Check return value of save_successor
|
||||||
# TODO: Also update lineage renewal config with any relevant
|
# TODO: Also update lineage renewal config with any relevant
|
||||||
# configuration values from this attempt? <- Absolutely (jdkasten)
|
# configuration values from this attempt? <- Absolutely (jdkasten)
|
||||||
@@ -419,7 +420,7 @@ def _auth_from_domains(le_client, config, domains):
|
|||||||
if lineage is False:
|
if lineage is False:
|
||||||
raise errors.Error("Certificate could not be obtained")
|
raise errors.Error("Certificate could not be obtained")
|
||||||
|
|
||||||
if lineage is not None:
|
if not config.dry_run:
|
||||||
_report_new_cert(lineage.cert, lineage.fullchain)
|
_report_new_cert(lineage.cert, lineage.fullchain)
|
||||||
|
|
||||||
return lineage, action
|
return lineage, action
|
||||||
|
|||||||
Reference in New Issue
Block a user