From 0e04b853f6f85ff3dfde0128724abc27efb5ccbd Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 21 Nov 2019 16:42:03 -0500 Subject: [PATCH] Fix common usage of noderange alerts This fixes the usual circumstance of not having keyed input data. --- confluent_server/confluent/messages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 07dc432f..4be79516 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -1379,6 +1379,8 @@ class InputAlertDestination(ConfluentMessage): self.alertcfg = {} if multinode: # keys are node names for node in inputdata: + if not isinstance(inputdata[node], dict): + break self.alertcfg[node] = inputdata[node] for key in inputdata[node]: if key not in self.valid_alert_params: @@ -1391,7 +1393,8 @@ class InputAlertDestination(ConfluentMessage): else: self.alertcfg[node][key] = \ self.valid_alert_params[key](inputdata[node][key]) - else: + else: + return for key in inputdata: if key not in self.valid_alert_params: raise exc.InvalidArgumentException(