Skip to content

Commit

Permalink
Made tags optional
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmatias committed Aug 7, 2024
1 parent e456695 commit 418d475
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions webhooks/falco/alerta_falco.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def incoming(self, query_string, payload):

# checking fields
#
expected_fields = ['priority', 'hostname', 'rule', 'output_fields', 'source', 'output', 'tags']
expected_fields = ['priority', 'hostname', 'rule', 'output_fields', 'source', 'output']
for field in expected_fields:
if not field in payload:
raise Exception(f'{field} not found in payload')
Expand Down Expand Up @@ -55,9 +55,11 @@ def incoming(self, query_string, payload):
attributes = additional_attributes

# tags
if not type(payload['tags']) == list:
raise Exception('tags should be a list')
tags = additional_tags.extend(payload['tags'])
tags = []
if 'tags' in payload and type(payload['tags']) == list:
tags = additional_tags.extend(payload['tags'])
else:
tags = additional_tags

# group
#
Expand Down
2 changes: 1 addition & 1 deletion webhooks/falco/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import find_packages, setup

version = '0.0.2'
version = '0.0.3'

setup(
name='alerta-falco',
Expand Down

0 comments on commit 418d475

Please sign in to comment.