Subscribe to correct event for FIP assoc/disassoc

Subscribe to the correct floatingip event for events that broadcast
when a nova associate or disassociate floating IP takes place.

Change-Id: I9aa0704fc7de75b22ecfb8795a65671e8ffcae23
Closes-bug: #1576886
This commit is contained in:
Adam Gandelman 2016-04-29 15:32:48 -07:00
parent be4e3965e1
commit 3f26c9a298
2 changed files with 21 additions and 0 deletions

View File

@ -79,6 +79,8 @@ _ROUTER_INTERESTING_NOTIFICATIONS = set([
'port.change.end',
'port.delete.end',
'floatingip.create.end',
'floatingip.update.end',
# NOTE(adam_g): Not certain this floatingip.change.* is ever broadcast?
'floatingip.change.end',
'floatingip.delete.end'
])

View File

@ -237,6 +237,25 @@ class RouterDriverTest(base.RugTestBase):
tenant_id, event_type, payload)
self.assertEqual(res, expected)
def test_process_notifications_floatingips(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,
)
events = [
'floatingip.create.end',
'floatingip.update.end',
'floatingip.change.end',
'floatingip.delete.end']
[self._test_notification(fipe, payload, e) for fipe in events]
def test_process_notification_routerstatus(self):
self._test_notification('routerstatus.update', {}, None)