2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-26 11:30:23 +00:00

Collapse 'acknowledge' parameter to boolean, 'False' meaning False

When a client submits non-boolean data for acknowledge, coerce it into boolean in some reasonable way.
This commit is contained in:
Jarrod Johnson 2015-07-14 13:28:54 -04:00
parent f52eec6c19
commit 859aad793d

View File

@ -693,7 +693,7 @@ class AlertDestination(ConfluentMessage):
class InputAlertDestination(ConfluentMessage):
valid_alert_params = {
'acknowledge': lambda x: x,
'acknowledge': lambda x: False if type(x) in (unicode,str) and x.lower() == 'false' else bool(x),
'ip': lambda x: x,
'retries': lambda x: int(x)
}