From 142ced234b7561c24f2fd089090cf16b64566ae8 Mon Sep 17 00:00:00 2001 From: r5d Date: Wed, 26 Jul 2017 16:16:20 -0400 Subject: [PATCH] Add cert name in renewal error messages (#4932) (#4957) * Add cert name in renewal error messages (#4932) * certbot: Fix error message in `handle_renewal_request`. --- certbot/renewal.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/certbot/renewal.py b/certbot/renewal.py index 5c6697941..f3131c06f 100644 --- a/certbot/renewal.py +++ b/certbot/renewal.py @@ -389,14 +389,16 @@ def handle_renewal_request(config): disp = zope.component.getUtility(interfaces.IDisplay) disp.notification("Processing " + renewal_file, pause=False) lineage_config = copy.deepcopy(config) + lineagename = storage.lineagename_for_filename(renewal_file) # Note that this modifies config (to add back the configuration # elements from within the renewal configuration file). try: renewal_candidate = _reconstitute(lineage_config, renewal_file) except Exception as e: # pylint: disable=broad-except - logger.warning("Renewal configuration file %s produced an " - "unexpected error: %s. Skipping.", renewal_file, e) + logger.warning("Renewal configuration file %s (cert: %s) " + "produced an unexpected error: %s. Skipping.", + renewal_file, lineagename, e) logger.debug("Traceback was:\n%s", traceback.format_exc()) parse_failures.append(renewal_file) continue @@ -422,8 +424,9 @@ def handle_renewal_request(config): renew_skipped.append(renewal_candidate.fullchain) except Exception as e: # pylint: disable=broad-except # obtain_cert (presumably) encountered an unanticipated problem. - logger.warning("Attempting to renew cert from %s produced an " - "unexpected error: %s. Skipping.", renewal_file, e) + logger.warning("Attempting to renew cert (%s) from %s produced an " + "unexpected error: %s. Skipping.", lineagename, + renewal_file, e) logger.debug("Traceback was:\n%s", traceback.format_exc()) renew_failures.append(renewal_candidate.fullchain)