Bugfix - the "unsupported datasource" warning always appeared
The "unsupported datasource" warning was written to the log without checking the event_type, so it appeared for every raised/cleared alarm Change-Id: I5cf20afd4abba0b61278827415430cfd44892bad
This commit is contained in:
parent
2ed0b6a737
commit
493f8047c3
@ -39,15 +39,20 @@ class NovaNotifier(NotifierBase):
|
||||
}
|
||||
|
||||
def process_event(self, data, event_type):
|
||||
if data and data.get(VProps.VITRAGE_TYPE) in self.actions:
|
||||
action = self.actions[data.get(VProps.VITRAGE_TYPE)]
|
||||
if event_type == NotifierEventTypes.ACTIVATE_MARK_DOWN_EVENT:
|
||||
action(data.get(VProps.ID), True)
|
||||
elif event_type == NotifierEventTypes.DEACTIVATE_MARK_DOWN_EVENT:
|
||||
action(data.get(VProps.ID), False)
|
||||
elif data:
|
||||
LOG.warning('Unsupport datasource type %s for mark_down action',
|
||||
data.get(VProps.VITRAGE_TYPE))
|
||||
if not data or not event_type:
|
||||
return
|
||||
|
||||
if event_type == NotifierEventTypes.ACTIVATE_MARK_DOWN_EVENT or \
|
||||
event_type == NotifierEventTypes.DEACTIVATE_MARK_DOWN_EVENT:
|
||||
|
||||
is_down = event_type == NotifierEventTypes.ACTIVATE_MARK_DOWN_EVENT
|
||||
action = self.actions.get(data.get(VProps.VITRAGE_TYPE))
|
||||
|
||||
if action:
|
||||
action(data.get(VProps.ID), is_down)
|
||||
else:
|
||||
LOG.warning('Unsupport datasource type %s for mark_down '
|
||||
'action', data.get(VProps.VITRAGE_TYPE))
|
||||
|
||||
def _mark_host_down(self, host_id, is_down):
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user