Merge "Bugfix - the "unsupported datasource" warning always appeared"
This commit is contained in:
commit
aee558d197
@ -39,15 +39,20 @@ class NovaNotifier(NotifierBase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def process_event(self, data, event_type):
|
def process_event(self, data, event_type):
|
||||||
if data and data.get(VProps.VITRAGE_TYPE) in self.actions:
|
if not data or not event_type:
|
||||||
action = self.actions[data.get(VProps.VITRAGE_TYPE)]
|
return
|
||||||
if event_type == NotifierEventTypes.ACTIVATE_MARK_DOWN_EVENT:
|
|
||||||
action(data.get(VProps.ID), True)
|
if event_type == NotifierEventTypes.ACTIVATE_MARK_DOWN_EVENT or \
|
||||||
elif event_type == NotifierEventTypes.DEACTIVATE_MARK_DOWN_EVENT:
|
event_type == NotifierEventTypes.DEACTIVATE_MARK_DOWN_EVENT:
|
||||||
action(data.get(VProps.ID), False)
|
|
||||||
elif data:
|
is_down = event_type == NotifierEventTypes.ACTIVATE_MARK_DOWN_EVENT
|
||||||
LOG.warning('Unsupport datasource type %s for mark_down action',
|
action = self.actions.get(data.get(VProps.VITRAGE_TYPE))
|
||||||
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):
|
def _mark_host_down(self, host_id, is_down):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user