From 972c5cd73b2212ba0adaea2d286631ade895d276 Mon Sep 17 00:00:00 2001 From: sfc-gh-afedorov Date: Tue, 25 Aug 2020 07:46:12 -0700 Subject: [PATCH] [handlers] Add single handler use-case --- src/runners/alert_dispatcher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/runners/alert_dispatcher.py b/src/runners/alert_dispatcher.py index f15196d81..76b8c470d 100755 --- a/src/runners/alert_dispatcher.py +++ b/src/runners/alert_dispatcher.py @@ -43,7 +43,12 @@ def main(): results = [] handlers = alert.get('HANDLERS') - for handler in ['jira'] if handlers is None else handlers: + if handlers is None: + handlers = 'jira' + if isinstance(handlers, (str, dict)): + handlers = [handlers] + + for handler in handlers: if handler is None: results.append(None)