From 82c7530b6f429cb1d792e39f86bb450b65876b2f Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Fri, 27 Jul 2018 15:52:22 -0700 Subject: [PATCH] fix deletion --- lemur/pending_certificates/cli.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lemur/pending_certificates/cli.py b/lemur/pending_certificates/cli.py index 647c5407..6dc01679 100644 --- a/lemur/pending_certificates/cli.py +++ b/lemur/pending_certificates/cli.py @@ -97,11 +97,6 @@ def fetch_all_acme(): # add metrics to metrics extension new += 1 else: - pending_certificate_service.increment_attempt(pending_cert) - pending_certificate_service.update( - cert.get("pending_cert").id, - status=str(cert.get("last_error"))[0:128] - ) failed += 1 error_log = copy.deepcopy(log_data) error_log["message"] = "Pending certificate creation failure" @@ -114,6 +109,11 @@ def fetch_all_acme(): send_pending_failure_notification(pending_cert, notify_owner=pending_cert.notify) pending_certificate_service.delete_by_id(pending_cert.id) current_app.logger.error(error_log) + pending_certificate_service.increment_attempt(pending_cert) + pending_certificate_service.update( + cert.get("pending_cert").id, + status=str(cert.get("last_error"))[0:128] + ) log_data["message"] = "Complete" log_data["new"] = new log_data["failed"] = failed