Skip to content

Commit

Permalink
Updated export-alerts.py to account for empty yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBarnes committed Jan 18, 2024
1 parent 10f2228 commit be2a06e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tooling/export-alerts/export-alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ def readYamlData(dir, export_hidden):
data[resouceCategory][resourceType] = []

alerts = yaml.safe_load(f)
for alert in alerts:
if (not export_hidden) and ('visible' in alert) and (alert['visible'] == False):
continue
data[resouceCategory][resourceType].append(alert)
if alerts:
for alert in alerts:
if (not export_hidden) and ('visible' in alert) and (alert['visible'] == False):
continue
data[resouceCategory][resourceType].append(alert)

return data

Expand Down

0 comments on commit be2a06e

Please sign in to comment.