Skip to content

Commit

Permalink
debug typo fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgottlieb committed Feb 6, 2024
1 parent 8806d43 commit 4ac7747
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ci/aws-iam-check-keys/find_stale_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:
Expand Down

0 comments on commit 4ac7747

Please sign in to comment.