2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-17 21:23:18 +00:00

Add support for event ack timeout setting.

This commit is contained in:
Allan Vidal 2015-10-14 16:42:28 -03:00 committed by Juliana Motira
parent 7b26d2edfb
commit fe4797857d
2 changed files with 7 additions and 1 deletions

View File

@ -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)
}

View File

@ -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: