From a7fe734d73a9941fdb7608f6d6f30843a4f43912 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Thu, 29 Sep 2016 14:26:55 -0700 Subject: [PATCH] Move lineage.has_pending_deployment() check up to _auth_from_domains Less conceptually nice, but in the "renew" verb case it wasn't being called :( --- certbot/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/certbot/main.py b/certbot/main.py index 3557f65b3..ece600cf6 100644 --- a/certbot/main.py +++ b/certbot/main.py @@ -87,6 +87,12 @@ def _auth_from_domains(le_client, config, domains, lineage=None): # interested in action = "renew" + if action == "renew" and lineage.has_pending_deployment(): + logger.warn("Found a new cert /archive/ that was not linked to in /live/; " + "fixing and reinstalling..") + lineage.update_all_links_to(lineage.latest_common_version()) + return lineage, "reinstall" + if action == "reinstall": # The lineage already exists; allow the caller to try installing # it without getting a new certificate at all. @@ -165,11 +171,6 @@ def _handle_identical_cert_request(config, lineage): :rtype: tuple """ - if lineage.has_pending_deployment(): - logger.warn("Found a new cert /archive/ that was not linked to in /live/; " - "fixing and reinstalling..") - lineage.update_all_links_to(lineage.latest_common_version()) - return "reinstall", lineage if renewal.should_renew(config, lineage): return "renew", lineage if config.reinstall: