Add --dry-run support when renewing a lineage

This commit is contained in:
Brad Warren
2016-01-28 18:19:01 -08:00
parent 0db36afa09
commit 688b92f528
+2 -1
View File
@@ -404,6 +404,7 @@ def _auth_from_domains(le_client, config, domains):
# https://github.com/letsencrypt/letsencrypt/pull/777/files#r40498574
new_certr, new_chain, new_key, _ = le_client.obtain_certificate(domains)
# TODO: Check whether it worked! <- or make sure errors are thrown (jdk)
if not config.dry_run:
lineage.save_successor(
lineage.latest_common_version(), OpenSSL.crypto.dump_certificate(
OpenSSL.crypto.FILETYPE_PEM, new_certr.body.wrapped),
@@ -419,7 +420,7 @@ def _auth_from_domains(le_client, config, domains):
if lineage is False:
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)
return lineage, action