fix restore triggers error
The 'add_trigger' function may raise exception when initializing a trigger, it will cause the operationengine service always quit, we need to catch it to avaid that. Change-Id: I468956c180d3a1ca5ece6b6ca58ade612f6fa5ad
This commit is contained in:
parent
fcca3935af
commit
43f063ea84
|
@ -114,8 +114,15 @@ class OperationEngineManager(manager.Manager):
|
|||
break
|
||||
|
||||
for trigger in triggers:
|
||||
self.trigger_manager.add_trigger(trigger.id, trigger.type,
|
||||
trigger.properties)
|
||||
try:
|
||||
self.trigger_manager.add_trigger(trigger.id, trigger.type,
|
||||
trigger.properties)
|
||||
except Exception as e:
|
||||
LOG.error('Add trigger (id: "%s" type: "%s" properties: '
|
||||
'"%s") to manager error, reason: %s',
|
||||
trigger.id, trigger.type, trigger.properties,
|
||||
str(e))
|
||||
|
||||
if len(triggers) < limit:
|
||||
break
|
||||
marker = triggers[-1].id
|
||||
|
|
Loading…
Reference in New Issue