File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 55import logging
66import os
77import re
8+ import sys
9+
810import redshift_connector
911import threading
1012import time
@@ -850,9 +852,15 @@ def get_s3_audit_logs(
850852 else :
851853 curr_index -= 1
852854
853- logger .debug (
854- f'First audit log in start_time range: { audit_objects [curr_index ]["Key" ].split ("/" )[- 1 ]} '
855- )
855+ try :
856+ logger .debug (
857+ f'First audit log in start_time range: { audit_objects [curr_index ]["Key" ].split ("/" )[- 1 ]} '
858+ )
859+ except IndexError :
860+ logger .fatal (f"There was no user activity log available yet." )
861+ logger .fatal ("Make sure audit logging and user activity logging are enabled and await shipment of the logs." )
862+ sys .exit (1 )
863+
856864 return (connections , logs , databases , last_connections )
857865
858866
You can’t perform that action at this time.
0 commit comments