2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Fix non-noderange alert specification.

The change in to accomodate nodarange without per-node
distinct input claimed the single input data exclusively
for multimode.

Correct by pulling the singleton code to be common if the
check breaks from the for loop.
This commit is contained in:
Jarrod Johnson 2021-11-01 06:59:54 -04:00
parent 224663d0c8
commit 28a13da118

View File

@ -1471,18 +1471,18 @@ class InputAlertDestination(ConfluentMessage):
self.valid_alert_params[key](inputdata[node][key])
else:
return
for key in inputdata:
if key not in self.valid_alert_params:
raise exc.InvalidArgumentException(
'Unrecognized alert parameter ' + key)
if isinstance(inputdata[key], dict):
inputdata[key] = self.valid_alert_params[key](
inputdata[key]['value'])
else:
inputdata[key] = self.valid_alert_params[key](
inputdata[key])
for node in nodes:
self.alertcfg[node] = inputdata
for key in inputdata:
if key not in self.valid_alert_params:
raise exc.InvalidArgumentException(
'Unrecognized alert parameter ' + key)
if isinstance(inputdata[key], dict):
inputdata[key] = self.valid_alert_params[key](
inputdata[key]['value'])
else:
inputdata[key] = self.valid_alert_params[key](
inputdata[key])
for node in nodes:
self.alertcfg[node] = inputdata
def alert_params_by_node(self, node):
return self.alertcfg[node]