Fix incorrect expectation of return type for summary emails in notification cli, and add 1 to days in summary email

This commit is contained in:
Jasmine Schladen 2020-12-15 13:03:55 -08:00
parent 9d00464842
commit 787ca4f860
2 changed files with 4 additions and 7 deletions

View File

@ -85,15 +85,13 @@ def security_expiration_summary(exclude):
status = FAILURE_METRIC_STATUS status = FAILURE_METRIC_STATUS
try: try:
print("Starting to notify security team about expiring certificates!") print("Starting to notify security team about expiring certificates!")
success, failed = send_security_expiration_summary(exclude) status = send_security_expiration_summary(exclude)
print( print(
"Finished notifying security team about expiring certificates! " "Finished notifying security team about expiring certificates!"
f"Sent: {success} Failed: {failed}"
) )
status = SUCCESS_METRIC_STATUS
except Exception: except Exception:
sentry.captureException() sentry.captureException()
metrics.send( metrics.send(
"security_expiration_notification_job", "counter", 1, metric_tags={"status": status} "security_expiration_summary_notification_job", "counter", 1, metric_tags={"status": status}
) )

View File

@ -77,7 +77,6 @@
<tr> <tr>
<td style="font-family:Roboto-Regular,Helvetica,Arial,sans-serif;font-size:13px;color:#202020;line-height:1.5"> <td style="font-family:Roboto-Regular,Helvetica,Arial,sans-serif;font-size:13px;color:#202020;line-height:1.5">
<br>This is a summary of all certificates expiring soon. <br>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. Certificates with notifications disabled have been omitted.
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:12px;margin-bottom:48px"> <table border="0" cellspacing="0" cellpadding="0" style="margin-top:12px;margin-bottom:48px">
<tbody> <tbody>
@ -87,7 +86,7 @@
<td width="16px"></td> <td width="16px"></td>
<td style="line-height:1.2"> <td style="line-height:1.2">
<span style="font-family:Roboto-Regular,Helvetica,Arial,sans-serif;font-size:24px;color:#202020"> <span style="font-family:Roboto-Regular,Helvetica,Arial,sans-serif;font-size:24px;color:#202020">
<br>Expiring in {{ interval_and_certs["interval"] }} days<br> <br>Expiring in {{ interval_and_certs["interval"] + 1 }} days<br>
</span> </span>
</td> </td>
</tr> </tr>