Merge "enrich_event should not be a static method"

This commit is contained in:
Jenkins 2016-12-15 17:19:51 +00:00 committed by Gerrit Code Review
commit c4542eaaa5
11 changed files with 11 additions and 23 deletions

View File

@ -44,8 +44,7 @@ class CinderVolumeDriver(DriverBase):
datasource_action,
'manager')
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
event[DSProps.EVENT_TYPE] = event_type
return CinderVolumeDriver.make_pickleable([event],

View File

@ -81,9 +81,7 @@ class DriverBase(object):
def _add_datasource_action(entity, datasource_action):
entity[DSProps.DATASOURCE_ACTION] = datasource_action
@staticmethod
@abc.abstractmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
"""Return the given event with extra fields
We add extra data, which the transformer uses later on.

View File

@ -63,8 +63,7 @@ class HeatStackDriver(DriverBase):
'orchestration.stack.resume.error',
'orchestration.stack.resume.end']
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
# TODO(Nofar): add call to get resources of the stack if not deleted
# change transformer that if delete we remove the stack from the graph
# and hence all the edges to it

View File

@ -27,8 +27,7 @@ class NetworkDriver(NeutronBase):
'network.update.end',
'network.delete.end']
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
event[DSProps.EVENT_TYPE] = event_type
return NetworkDriver.make_pickleable([event],

View File

@ -27,8 +27,7 @@ class PortDriver(NeutronBase):
'port.update.end',
'port.delete.end']
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
event[DSProps.EVENT_TYPE] = event_type
return PortDriver.make_pickleable([event], NEUTRON_PORT_DATASOURCE,

View File

@ -34,8 +34,7 @@ class InstanceDriver(NovaDriverBase):
'OS-EXT-SRV-ATTR:user_data',
'_info')
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
event[DSProps.EVENT_TYPE] = event_type
return InstanceDriver.make_pickleable([event],

View File

@ -45,8 +45,7 @@ class StaticDriver(DriverBase):
def get_event_types():
return []
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
pass
def get_all(self, datasource_action):

View File

@ -32,8 +32,7 @@ class StaticPhysicalDriver(DriverBase):
def get_event_types():
return []
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
pass
ENTITIES_SECTION = 'entities'

View File

@ -171,8 +171,7 @@ class ZabbixDriver(AlarmDriverBase):
LOG.exception('failed in init %s ', e)
return {}
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
event[DSProps.EVENT_TYPE] = event_type
if ZabbixDriver.conf_map:

View File

@ -27,8 +27,7 @@ class MockNagiosDriver(NagiosDriver):
def get_event_types():
return []
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
pass
def __init__(self, conf):

View File

@ -27,8 +27,7 @@ class MockZabbixDriver(ZabbixDriver):
def get_event_types():
return []
@staticmethod
def enrich_event(event, event_type):
def enrich_event(self, event, event_type):
pass
def __init__(self, conf):