From 4ac774714225b32ff143f5e5390387d0dccfce02 Mon Sep 17 00:00:00 2001 From: Robert Gottlieb Date: Tue, 6 Feb 2024 15:22:50 -0500 Subject: [PATCH] debug typo fixed --- ci/aws-iam-check-keys/find_stale_keys.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/aws-iam-check-keys/find_stale_keys.py b/ci/aws-iam-check-keys/find_stale_keys.py index f9fec6d..af6747e 100644 --- a/ci/aws-iam-check-keys/find_stale_keys.py +++ b/ci/aws-iam-check-keys/find_stale_keys.py @@ -127,6 +127,8 @@ def send_alerts(cleared, events, db): event.cleared = True if cleared else False event.alert_sent = True event.save() + print(f'stale_key_num{{user="{user_string}", alert_type="{alert_type}", key="{access_key_num}", last_rotated="{access_key_last_rotated}"}} {cleared_int}\n') + # Send alerts to prometheus to update alerts prometheus_url = f'http://{os.getenv("GATEWAY_HOST")}:{os.getenv("GATEWAY_PORT", "9091")}/metrics/job/find_stale_keys' @@ -140,7 +142,6 @@ def send_alerts(cleared, events, db): else: print(f'Warning! Metrics failed to record! See Logs status_code: {res.status_code} reason: {res.reason}') transaction.rollback() - print(f'stale_key_num{{user="{user_string}", alert_type="{alert_type}", key="{access_key_num}", last_rotated="{access_key_last_rotated}"}} {cleared_int}\n') def send_all_alerts(db): try: