From 787ca4f860bafcf3ef375ef186271b7a0b25905d Mon Sep 17 00:00:00 2001 From: Jasmine Schladen Date: Tue, 15 Dec 2020 13:03:55 -0800 Subject: [PATCH] Fix incorrect expectation of return type for summary emails in notification cli, and add 1 to days in summary email --- lemur/notifications/cli.py | 8 +++----- .../plugins/lemur_email/templates/expiration_summary.html | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lemur/notifications/cli.py b/lemur/notifications/cli.py index d86028c0..a26dc8c5 100644 --- a/lemur/notifications/cli.py +++ b/lemur/notifications/cli.py @@ -85,15 +85,13 @@ def security_expiration_summary(exclude): status = FAILURE_METRIC_STATUS try: print("Starting to notify security team about expiring certificates!") - success, failed = send_security_expiration_summary(exclude) + status = send_security_expiration_summary(exclude) print( - "Finished notifying security team about expiring certificates! " - f"Sent: {success} Failed: {failed}" + "Finished notifying security team about expiring certificates!" ) - status = SUCCESS_METRIC_STATUS except Exception: sentry.captureException() metrics.send( - "security_expiration_notification_job", "counter", 1, metric_tags={"status": status} + "security_expiration_summary_notification_job", "counter", 1, metric_tags={"status": status} ) diff --git a/lemur/plugins/lemur_email/templates/expiration_summary.html b/lemur/plugins/lemur_email/templates/expiration_summary.html index d2e98196..ca6b3c6a 100644 --- a/lemur/plugins/lemur_email/templates/expiration_summary.html +++ b/lemur/plugins/lemur_email/templates/expiration_summary.html @@ -77,7 +77,6 @@
This is a summary of all certificates expiring soon. - Only certificates matching the configured expiration intervals are included here. Certificates with notifications disabled have been omitted. @@ -87,7 +86,7 @@
-
Expiring in {{ interval_and_certs["interval"] }} days
+
Expiring in {{ interval_and_certs["interval"] + 1 }} days