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, datasource_action,
'manager') 'manager')
@staticmethod def enrich_event(self, event, event_type):
def enrich_event(event, event_type):
event[DSProps.EVENT_TYPE] = event_type event[DSProps.EVENT_TYPE] = event_type
return CinderVolumeDriver.make_pickleable([event], return CinderVolumeDriver.make_pickleable([event],

View File

@ -81,9 +81,7 @@ class DriverBase(object):
def _add_datasource_action(entity, datasource_action): def _add_datasource_action(entity, datasource_action):
entity[DSProps.DATASOURCE_ACTION] = datasource_action entity[DSProps.DATASOURCE_ACTION] = datasource_action
@staticmethod def enrich_event(self, event, event_type):
@abc.abstractmethod
def enrich_event(event, event_type):
"""Return the given event with extra fields """Return the given event with extra fields
We add extra data, which the transformer uses later on. 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.error',
'orchestration.stack.resume.end'] 'orchestration.stack.resume.end']
@staticmethod def enrich_event(self, event, event_type):
def enrich_event(event, event_type):
# TODO(Nofar): add call to get resources of the stack if not deleted # 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 # change transformer that if delete we remove the stack from the graph
# and hence all the edges to it # and hence all the edges to it

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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