diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 14c20838..4af17429 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -631,6 +631,7 @@ class InputDomainName(ConfluentInputMessage): if len(inputdata['domain_name']) > 256: raise exc.InvalidArgumentException( 'identifier must be less than or = 256 chars') + if nodes is None: raise exc.InvalidArgumentException( 'This only supports per-node input') @@ -871,12 +872,13 @@ class UserCollection(ConfluentMessage): class AlertDestination(ConfluentMessage): - def __init__(self, ip, acknowledge=False, retries=0, name=None): + def __init__(self, ip, acknowledge=False, acknowledge_timeout=None, retries=0, name=None): self.desc = 'foo' self.stripped = False self.notnode = name is None kvpairs = {'ip': {'value': ip}, 'acknowledge': {'value': acknowledge}, + 'acknowledge_timeout': {'value': acknowledge_timeout}, 'retries': {'value': retries}} if self.notnode: self.kvpairs = kvpairs @@ -887,6 +889,7 @@ class AlertDestination(ConfluentMessage): class InputAlertDestination(ConfluentMessage): valid_alert_params = { 'acknowledge': lambda x: False if type(x) in (unicode,str) and x.lower() == 'false' else bool(x), + 'acknowledge_timeout': lambda x: int(x) if x and x.isdigit() else None, 'ip': lambda x: x, 'retries': lambda x: int(x) } diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 565d01b5..31630c2e 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -406,6 +406,7 @@ class IpmiHandler(object): self.output.put(msg.AlertDestination( ip=destdata['address'], acknowledge=destdata['acknowledge_required'], + acknowledge_timeout=destdata.get('acknowledge_timeout', None), retries=destdata['retries'], name=self.node)) return @@ -415,6 +416,8 @@ class IpmiHandler(object): alertargs = {} if 'acknowledge' in alertparms: alertargs['acknowledge_required'] = alertparms['acknowledge'] + if 'acknowledge_timeout' in alertparms: + alertargs['acknowledge_timeout'] = alertparms['acknowledge_timeout'] if 'ip' in alertparms: alertargs['ip'] = alertparms['ip'] if 'retries' in alertparms: