Merge "Properly limit router driver event processing"
This commit is contained in:
commit
f4361d459d
|
@ -68,12 +68,16 @@ _ROUTER_INTERFACE_NOTIFICATIONS = set([
|
|||
])
|
||||
|
||||
_ROUTER_INTERESTING_NOTIFICATIONS = set([
|
||||
'router.change.end',
|
||||
'subnet.create.end',
|
||||
'subnet.change.end',
|
||||
'subnet.delete.end',
|
||||
'port.create.end',
|
||||
'port.change.end',
|
||||
'port.delete.end',
|
||||
'floatingip.create.end',
|
||||
'floatingip.change.end',
|
||||
'floatingip.delete.end'
|
||||
])
|
||||
|
||||
|
||||
|
@ -283,8 +287,6 @@ class Router(BaseDriver):
|
|||
router_id = payload.get('router.interface', {}).get('id')
|
||||
elif event_type in _ROUTER_INTERESTING_NOTIFICATIONS:
|
||||
crud = event.UPDATE
|
||||
elif event_type.endswith('.end'):
|
||||
crud = event.UPDATE
|
||||
else:
|
||||
LOG.debug('Not processing event: %s' % event_type)
|
||||
return
|
||||
|
|
|
@ -294,19 +294,6 @@ class RouterDriverTest(base.RugTestBase):
|
|||
)
|
||||
self._test_notification(notification, payload, e)
|
||||
|
||||
def test_process_notification_arbitrary_end_event(self):
|
||||
payload = {'router': {'id': 'fake_router_id'}}
|
||||
r = event.Resource(
|
||||
driver=router.Router.RESOURCE_NAME,
|
||||
id='fake_router_id',
|
||||
tenant_id='fake_tenant_id')
|
||||
e = event.Event(
|
||||
resource=r,
|
||||
crud=event.UPDATE,
|
||||
body=payload,
|
||||
)
|
||||
self._test_notification('foo.bar.end', payload, e)
|
||||
|
||||
def test_process_notification_not_subscribed(self):
|
||||
payload = {'router': {'id': 'fake_router_id'}}
|
||||
self._test_notification('whocares.about.this', payload, None)
|
||||
|
|
Loading…
Reference in New Issue