Skip to content

Commit

Permalink
Merge pull request #40 from partcyborg/add-receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
jpavlav authored Sep 30, 2024
2 parents 4defe61 + 6c9f1e0 commit 4add45e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions alertmanager/alertmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _validate_get_alert_kwargs(self, **kwargs):
doesn't understand from being passed in a request.
"""
valid_keys = ['filter', 'silenced', 'inhibited']
valid_keys = ['filter', 'silenced', 'inhibited', 'receiver']
for key in kwargs.keys():
if key not in valid_keys:
raise KeyError('invalid get parameter {}'.format(key))
Expand Down Expand Up @@ -232,9 +232,9 @@ def _handle_filters(self, filter_dict):
Returns
-------
str
Returns a filter string to be passed along with our get_alerts
method call.
list
Returns a list of filter strings to be passed along with our
get_alerts method call.
"""
if not isinstance(filter_dict, dict):
Expand All @@ -244,8 +244,7 @@ def _handle_filters(self, filter_dict):
for key, value in filter_dict.items():
string = starter_string.format(key, value)
filter_list.append(string)
final_filter_string = ','.join(filter_list)
return '{{{}}}'.format(final_filter_string)
return filter_list

def post_alerts(self, *alert):
"""
Expand Down

0 comments on commit 4add45e

Please sign in to comment.