Skip to content

Commit 2b128e4

Browse files
committed
fix: unit tests
1 parent b017387 commit 2b128e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

functions/notify_slack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,11 @@ def parse_notification(message: Dict[str, Any], subject: Optional[str], region:
514514
"""
515515
if "AlarmName" in message:
516516
return format_cloudwatch_alarm(message=message, region=region)
517-
if message.get("detail-type") == "GuardDuty Finding":
517+
if isinstance(message, Dict) and message.get("detail-type") == "GuardDuty Finding":
518518
return format_guardduty_finding(message=message, region=message["region"])
519-
if message.get("detail-type") == "Security Hub Findings - Imported":
519+
if isinstance(message, Dict) and message.get("detail-type") == "Security Hub Findings - Imported":
520520
return format_aws_security_hub(message=message, region=message["region"])
521-
if message.get("detail-type") == "AWS Health Event":
521+
if isinstance(message, Dict) and message.get("detail-type") == "AWS Health Event":
522522
return format_aws_health(message=message, region=message["region"])
523523
if subject == "Notification from AWS Backup":
524524
return format_aws_backup(message=str(message))

0 commit comments

Comments
 (0)