Merge "fix port filtering"
This commit is contained in:
commit
beb79929d3
@ -29,9 +29,13 @@ class PortDriver(NeutronBase):
|
|||||||
|
|
||||||
def enrich_event(self, event, event_type):
|
def enrich_event(self, event, event_type):
|
||||||
event[DSProps.EVENT_TYPE] = event_type
|
event[DSProps.EVENT_TYPE] = event_type
|
||||||
|
if 'compute' not in event.get('port', {}).get('device_owner', ''):
|
||||||
|
return []
|
||||||
|
|
||||||
return PortDriver.make_pickleable([event], NEUTRON_PORT_DATASOURCE,
|
enriched_event = \
|
||||||
|
PortDriver.make_pickleable([event], NEUTRON_PORT_DATASOURCE,
|
||||||
DatasourceAction.UPDATE)[0]
|
DatasourceAction.UPDATE)[0]
|
||||||
|
return enriched_event
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def properties_to_filter_out():
|
def properties_to_filter_out():
|
||||||
@ -40,7 +44,7 @@ class PortDriver(NeutronBase):
|
|||||||
|
|
||||||
def get_all(self, datasource_action):
|
def get_all(self, datasource_action):
|
||||||
ports = self.client.list_ports()['ports']
|
ports = self.client.list_ports()['ports']
|
||||||
ports = [p for p in ports if p.get('device_owner') == 'compute:nova']
|
ports = [p for p in ports if 'compute' in p.get('device_owner', '')]
|
||||||
return self.make_pickleable(
|
return self.make_pickleable(
|
||||||
ports,
|
ports,
|
||||||
NEUTRON_PORT_DATASOURCE,
|
NEUTRON_PORT_DATASOURCE,
|
||||||
|
Loading…
Reference in New Issue
Block a user